After 07d410e0) serial: sirf: fix spinlock deadlock issue it is no longer
possiblet to compile this driver. The rename of one of the spinlocks is
faulty. After looking at the original patch I believe this is the correct
fix.
Compile tested using ARM's multi_v7_defconfig
Cc: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
Cc: Jiri Slaby <jslaby(a)suse.cz>
Cc: Barry Song <baohua(a)kernel.org>
Cc: Qipan Li <Qipan.Li(a)csr.com>
Cc: linux-serial(a)vger.kernel.org
Signed-off-by: Daniel Thompson <daniel.thompson(a)linaro.org>
---
drivers/tty/serial/sirfsoc_uart.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/tty/serial/sirfsoc_uart.c b/drivers/tty/serial/sirfsoc_uart.c
index 236f892..1f2be48 100644
--- a/drivers/tty/serial/sirfsoc_uart.c
+++ b/drivers/tty/serial/sirfsoc_uart.c
@@ -704,7 +704,7 @@ static void sirfsoc_uart_rx_dma_complete_tl(unsigned long param)
struct sirfsoc_int_en *uint_en = &sirfport->uart_reg->uart_int_en;
unsigned long flags;
struct dma_tx_state tx_state;
- spin_lock_irqsave(&port->rx_lock, flags);
+ spin_lock_irqsave(&port->lock, flags);
while (DMA_COMPLETE == dmaengine_tx_status(sirfport->rx_dma_chan,
sirfport->rx_dma_items[sirfport->rx_completed].cookie, &tx_state)) {
sirfsoc_uart_insert_rx_buf_to_tty(sirfport,
--
1.9.0
This patchset contains a number of fixes to make it possible to use
ttyNMIX as the primary console, providing you also have that the
additional architecture specific code to support it.
The first patch is a generic improvement to make the behaviour of
poll_put_char consistent for all UARTs. This is especially important
for kgdb_nmi, which makes unusually heavy use of poll_put_char,
although this fix also benefits other users of polled I/O.
The remaining patches are specific to kgdb_nmi and have no effect on
any other part of the kernel.
The series has been runtime tested on ARM and compile tested on
x86 and powerpc.
Daniel Thompson (4):
serial: core: Consistent LF handling for poll_put_char
serial: kgdb_nmi: Use container_of() to locate private data
serial: kgdb_nmi: Switch from tasklets to real timers
serial: kgdb_nmi: Improve console integration with KDB I/O
drivers/tty/serial/8250/8250_core.c | 5 ---
drivers/tty/serial/cpm_uart/cpm_uart_core.c | 8 ++--
drivers/tty/serial/kgdb_nmi.c | 59 +++++++++++++----------------
drivers/tty/serial/pch_uart.c | 5 ---
drivers/tty/serial/pxa.c | 5 ---
drivers/tty/serial/serial_core.c | 2 +
drivers/tty/serial/serial_txx9.c | 5 ---
7 files changed, 33 insertions(+), 56 deletions(-)
--
1.9.0
3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Viresh Kumar <viresh.kumar(a)linaro.org>
commit 27630532ef5ead28b98cfe28d8f95222ef91c2b7 upstream.
Since commit d689fe222 (NOHZ: Check for nohz active instead of nohz
enabled) the tick_nohz_switch_to_nohz() function returns because it
checks for the tick_nohz_active flag. This can't be set, because the
function itself sets it.
Undo the change in tick_nohz_switch_to_nohz().
Signed-off-by: Viresh Kumar <viresh.kumar(a)linaro.org>
Cc: linaro-kernel(a)lists.linaro.org
Cc: fweisbec(a)gmail.com
Cc: Arvind.Chauhan(a)arm.com
Cc: linaro-networking(a)linaro.org
Link: http://lkml.kernel.org/r/40939c05f2d65d781b92b20302b02243d0654224.139753798…
Signed-off-by: Thomas Gleixner <tglx(a)linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
---
kernel/time/tick-sched.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/kernel/time/tick-sched.c
+++ b/kernel/time/tick-sched.c
@@ -970,7 +970,7 @@ static void tick_nohz_switch_to_nohz(voi
struct tick_sched *ts = &__get_cpu_var(tick_cpu_sched);
ktime_t next;
- if (!tick_nohz_active)
+ if (!tick_nohz_enabled)
return;
local_irq_disable();
3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Viresh Kumar <viresh.kumar(a)linaro.org>
commit 03e6bdc5c4d0fc166bfd5d3cf749a5a0c1b5b1bd upstream.
In tick_do_update_jiffies64() we are processing ticks only if delta is
greater than tick_period. This is what we are supposed to do here and
it broke a bit with this patch:
commit 47a1b796 (tick/timekeeping: Call update_wall_time outside the
jiffies lock)
With above patch, we might end up calling update_wall_time() even if
delta is found to be smaller that tick_period. Fix this by returning
when the delta is less than tick period.
[ tglx: Made it a 3 liner and massaged changelog ]
Signed-off-by: Viresh Kumar <viresh.kumar(a)linaro.org>
Cc: linaro-kernel(a)lists.linaro.org
Cc: fweisbec(a)gmail.com
Cc: Arvind.Chauhan(a)arm.com
Cc: linaro-networking(a)linaro.org
Cc: John Stultz <john.stultz(a)linaro.org>
Link: http://lkml.kernel.org/r/80afb18a494b0bd9710975bcc4de134ae323c74f.139753798…
Signed-off-by: Thomas Gleixner <tglx(a)linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
---
kernel/time/tick-sched.c | 3 +++
1 file changed, 3 insertions(+)
--- a/kernel/time/tick-sched.c
+++ b/kernel/time/tick-sched.c
@@ -84,6 +84,9 @@ static void tick_do_update_jiffies64(kti
/* Keep the tick_next_period variable up to date */
tick_next_period = ktime_add(last_jiffies_update, tick_period);
+ } else {
+ write_sequnlock(&jiffies_lock);
+ return;
}
write_sequnlock(&jiffies_lock);
update_wall_time();
Joe Usershwartzen liked your message with Boxer. On May 28, 2014 at 10:55:39 AM CDT, Kevin Hilman <khilman(a)linaro.org> wrote:Hi Will,Will Deacon writes:> On Mon, May 26, 2014 at 07:56:13PM +0100, Larry Bassel wrote:>> Make calls to ct_user_enter when the kernel is exited>> and ct_user_exit when the kernel is entered (in el0_da,>> el0_ia, el0_svc, el0_irq and all of the "error" paths).>> >> These macros expand to function calls which will only work>> properly if el0_sync and related code has been rearranged>> (in a previous patch of this series).>> >> The calls to ct_user_exit are made after hw debugging has been>> enabled (enable_dbg_and_irq).>> >> The call to ct_user_enter is made at the beginning of the>> kernel_exit macro.>> >> This patch is based on earlier work by Kevin Hilman.>> Save/restore optimizations were also done by Kevin.>> Apologies if we've discussed this before (it rings a bell), but why are we> penalising the fast syscall path with this? Shouldn't TIF_NOHZ contribute to> out _TIF_WORK_MASK, then we could do the tracking on the syscall slow path?I'll answer here since Larry inherited this design decision from me.I considered (and even implemented) forcing the slow syscall pathbased on TIF_NOHZ but decided (perhaps wrongly) not to. I guess thechoice is between:- forcing the overhead of syscall tracing path on all TIF_NOHZ processes- forcing the (much smaller) ct_user_exit overhead on all syscalls, (including the fast syscall path)I had decided that the former was better, but as I write this, I'mthinking that the NOHZ tasks should probably eat the extra overheadsince we expect their interactions with the kernel to be minimal anyways(part of the goal of full NOHZ.)Ultimately, I'm OK with either way and have the other version ready.> I think that would tidy up your mov into x19 too.That's correct. If we force the syscall_trace path, the ct_user_enterwouldn't have to do any context save/restore.> Also -- how do you track ret_from_fork in the child with these patches?Not sure I follow the question, but ret_from_fork callsret_to_user, which calls kernel_exit, which calls ct_user_enter.Kevin--To unsubscribe from this list: send the line "unsubscribe linux-kernel" inthe body of a message to majordomo(a)vger.kernel.orgMore majordomo info at http://vger.kernel.org/majordomo-info.htmlPlease read the FAQ at http://www.tux.org/lkml/
Hi,
Here is updated patches to address KVM host support in big endian
ARM V7/V8.
Changes since previous version [1] and [2]:
x) joined both v7 [1] and v8 [2] series into one
x) addressed, nearly all, Christoffer's comments to previous
patch series
x) Fixed few issues in 'ARM: KVM: handle 64bit values passed to
mrcc or from mcrr instructions in BE case' that got discovered
after moving to the latest v3.15-rc5 kernel
x) Fixed issue in supporting 32bit guest by V8 BE KVM host
All patches except 'ARM: KVM: one_reg coproc set and
get BE fixes', as far as I see, are best possible proposal.
'ARM: KVM: one_reg coproc set and get BE fixes' changes still
need more discussion. Patch included with this series covers
one possible solution, I'll post notes about other approach
previously suggested by Alex Graf separately.
The patches were tested on top of v3.15-rc5 on TC2 (V7) and
fastmodels (V8). Tested all possible combinations of KVM host
and guests (V7/V8, BE/LE, 64bit/32bit).
Thanks,
Victor
[1] http://lists.infradead.org/pipermail/linux-arm-kernel/2014-February/231881.…
[2] http://lists.infradead.org/pipermail/linux-arm-kernel/2014-February/231889.…
Victor Kamensky (14):
ARM: KVM: switch hypervisor into BE mode in case of BE host
ARM: KVM: fix vgic V7 assembler code to work in BE image
ARM: KVM: handle 64bit values passed to mrcc or from mcrr instructions
in BE case
ARM: KVM: __kvm_vcpu_run function return result fix in BE case
ARM: KVM: vgic mmio should hold data as LE bytes array in BE case
ARM: KVM: MMIO support BE host running LE code
ARM: KVM: one_reg coproc set and get BE fixes
ARM: KVM: enable KVM in Kconfig on big-endian systems
ARM64: KVM: MMIO support BE host running LE code
ARM64: KVM: store kvm_vcpu_fault_info est_el2 as word
ARM64: KVM: fix vgic_bitmap_get_reg function for BE 64bit case
ARM64: KVM: vgic_elrsr and vgic_eisr need to be byteswapped in BE case
ARM64: KVM: set and get of sys registers in BE case
ARM64: KVM: fix big endian issue in access_vm_reg for 32bit guest
arch/arm/include/asm/kvm_asm.h | 18 ++++++
arch/arm/include/asm/kvm_emulate.h | 22 +++++--
arch/arm/kvm/Kconfig | 2 +-
arch/arm/kvm/coproc.c | 118 +++++++++++++++++++++++++++--------
arch/arm/kvm/init.S | 7 ++-
arch/arm/kvm/interrupts.S | 9 ++-
arch/arm/kvm/interrupts_head.S | 20 +++++-
arch/arm64/include/asm/kvm_emulate.h | 22 +++++++
arch/arm64/kvm/hyp.S | 9 ++-
arch/arm64/kvm/sys_regs.c | 33 +++++++---
virt/kvm/arm/vgic.c | 28 +++++++--
11 files changed, 237 insertions(+), 51 deletions(-)
--
1.8.1.4
From: Mark Brown <broonie(a)linaro.org>
This reposting of the series rolls together the work from myself and Zi
Shen, it includes the revisions Lorenzo provided on the last round of
review. It is also available at:
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/misc.git tags/arm64-topology-dt-mpidr
Mark Brown (4):
arm64: topology: Initialise default topology state immediately
arm64: topology: Add support for topology DT bindings
arm64: topology: Tell the scheduler about the relative power of cores
arm64: topology: Provide relative power numbers for cores
Zi Shen Lim (2):
arm64: sched: Remove unused mc_capable() and smt_capable()
arm64: topology: add MPIDR-based detection
arch/arm64/include/asm/cputype.h | 5 +
arch/arm64/include/asm/topology.h | 3 -
arch/arm64/kernel/topology.c | 411 ++++++++++++++++++++++++++++++++++++--
3 files changed, 401 insertions(+), 18 deletions(-)
--
1.9.2
This is third attempt to initialize CPU's OPPs from CPU core code. First two are
here: https://lkml.org/lkml/2014/5/19/57 and https://lkml.org/lkml/2014/5/21/199
Drivers expecting CPU's OPPs from device tree initialize OPP table themselves by
calling of_init_opp_table() and there is nothing driver specific in that. They
all do it in the same redundant way.
It would be better if we can get rid of redundancy by initializing CPU OPPs from
CPU core code for all CPUs (that have a "operating-points" property defined in
their node).
This patchset is all about that.
The idea was initially discussed here: https://lkml.org/lkml/2014/5/17/123
V2->V3:
- s/dev_info/dev_dbg
- Fixed changelogs
V1->V2:
- Addition of two new patches: 1/2 & 2/2
- Created separate routine of_init_cpu_opp_table() which wouldn't add any
overhead for the platforms which don't have OPP or OF enabled.
- Added a print for success case as well
- Added Acks from Shawn
- Got rid of extra indentation level by returning early from register_cpu().
Cc: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
Cc: Amit Daniel Kachhap <amit.daniel(a)samsung.com>
Cc: Kukjin Kim <kgene.kim(a)samsung.com>
Cc: Shawn Guo <shawn.guo(a)linaro.org>
Viresh Kumar (8):
cpufreq: cpufreq-cpu0: remove dependency on thermal
opp: of_init_opp_table(): return -ENOSYS when feature isn't
implemented
opp: call of_node_{get|put}() from of_init_opp_table()
driver/core: cpu: initialize opp table
cpufreq: arm_big_little: don't initialize opp table
cpufreq: imx6q: don't initialize opp table
cpufreq: cpufreq-cpu0: don't initialize opp table
cpufreq: exynos5440: don't initialize opp table
arch/arm/mach-imx/mach-imx6q.c | 36 ++++++++----------------------------
drivers/base/cpu.c | 30 ++++++++++++++++++++++++++----
drivers/base/power/opp.c | 4 ++++
drivers/cpufreq/Kconfig | 2 +-
drivers/cpufreq/arm_big_little.c | 12 +++++++-----
drivers/cpufreq/arm_big_little_dt.c | 18 ------------------
drivers/cpufreq/cpufreq-cpu0.c | 6 ------
drivers/cpufreq/exynos5440-cpufreq.c | 6 ------
drivers/cpufreq/imx6q-cpufreq.c | 20 +-------------------
include/linux/pm_opp.h | 2 +-
10 files changed, 48 insertions(+), 88 deletions(-)
--
2.0.0.rc2
Dear all,
There's a question in the arch/arm64/kernel/entry.S as following,
/*
* EL1 mode handlers.
*/
el1_sync:
kernel_entry 1
mrs x1, esr_el1 // read the syndrome register
lsr x24, x1, #ESR_EL1_EC_SHIFT // exception class
cmp x24, #ESR_EL1_EC_DABT_EL1 // data abort in EL1
b.eq el1_da
cmp x24, #ESR_EL1_EC_SYS64 // configurable trap
b.eq el1_undef
cmp x24, #ESR_EL1_EC_SP_ALIGN // stack alignment exception
b.eq el1_sp_pc
el1_sp_pc:
/*
* Stack or PC alignment exception handling
*/
mrs x0, far_el1
- mov x1, x25 ==> this is an extra operation
mov x2, sp
b do_sp_pc_abort //Jump to C Exception handler
/**The C Exception Handler/
asmlinkage void __exception do_sp_pc_abort(unsigned long addr,
unsigned int esr,
struct pt_regs *regs)
{
...
}
We use x1 register to store the value of ESR, and check the value to
identify which exception handler to jump,
And there's a weird part In stack alignment exception handler(el1_sp_pc),
Why do we need to move x25 to x1?
The ESR has been stored into x1, and should be directly pass to
do_sp_pc_abort function
"MOV x1, x25" is an extra operation and do_sp_pc_abort would get the wrong
value of esr...
I'm not sure whether I'm right or not, hope someone can take a look at it,
thx
BRs
andy
Hi Guys,
I didn't had time to put in an effort on this but here is a problem
reported by Santosh. See if somebody can get this fixed..
arch/arm/mach-exynos/sleep.S: Assembler messages:
arch/arm/mach-exynos/sleep.S:57: Error: invalid immediate for address
calculation (value = 0x00000004)
Its because of THUMB2 and a probably fix would be something
like this:
https://lkml.org/lkml/2010/3/31/235
NOTE: Mainline's defconfig doesn't get this as THUMB2 isn't
enabled.
Reproduced on 3.15-rc6
--
viresh
Hi Guys,
Here is second version of series that enables KVM support for V7 big endian
kernels. Mostly it deals with BE KVM host support. Marc Zyngier showed before
with his patches how BE guest could run on top LE host. With these patches
BE guest runs on top of BE host. If Marc's kvmtool is used with few
additional changes I tested that BE host could run LE guest. Also I verified
that there were no regressions in BE guest on top of LE host case.
Note that posted series covers only kernel side changes. The changes were
tested inside of bigger setup with additional changes in qemu and kvmtool.
I will post those changes separately in proper aliases but for completeness
sake Appendix A gives pointers to git repositories and branches with all
needed changes.
Changes since V1:
1) Patch that handles issue of including assembler.h into kvm .S file now
handled separately. It was posted before on mailing list [1]. This series
depend on it.
2) Incorporated most of Christoffer V1 review comments. The only thing
I did not do wrt Christoffer's suggestion is possible rework of 'one_reg
coproc set and get BE fixes' patch. I think I put better explanation on
what my code does, and if it is still not good we will go from there.
3) Moved rr_lo_hi macro into arch/arm/include/asm/kvm_asm.h along the
lines Christoffer suggested
4) Split 'fix KVM assembler files to work in BE case' patch into 4 smaller
one each handling one logic issue.
Thanks,
Victor
[1] http://lists.infradead.org/pipermail/linux-arm-kernel/2014-February/231432.…
Victor Kamensky (7):
ARM: KVM: switch hypervisor into BE mode in case of BE host
ARM: KVM: fix vgic V7 assembler code to work in BE image
ARM: KVM: handle 64bit values passed to mrcc or from mcrr instructions
in BE case
ARM: KVM: __kvm_vcpu_run function return result fix in BE case
ARM: KVM: one_reg coproc set and get BE fixes
ARM: KVM: vgic mmio should hold data as LE bytes array in BE case
ARM: KVM: MMIO support BE host running LE code
arch/arm/include/asm/kvm_asm.h | 23 +++++++++-
arch/arm/include/asm/kvm_emulate.h | 22 +++++++--
arch/arm/kvm/coproc.c | 94 ++++++++++++++++++++++++++++----------
arch/arm/kvm/init.S | 7 ++-
arch/arm/kvm/interrupts.S | 9 +++-
arch/arm/kvm/interrupts_head.S | 32 +++++++++----
virt/kvm/arm/vgic.c | 4 +-
7 files changed, 145 insertions(+), 46 deletions(-)
--
1.8.1.4
Appendix A: Testing and Full Setup Description
----------------------------------------------
I) No mixed mode setup - i.e BE guest on BE host; and LE guest
on LE host tested to make sure no regressions.
KVM host and guest kernels:
TC2 on top of Linus 3.13 (this patch series):
git: git://git.linaro.org/people/victor.kamensky/linux-linaro-tracking-be.git
branch: arm-be-kvm-3.13
range: 7098f45..78419d0
TC2 and Arndale on top of Linaro BE tree:
git: git://git.linaro.org/people/victor.kamensky/linux-linaro-tracking-be.git
branch: llct-be-20140211-kvm
range: 308a752..ae47fa8
- TC1 kernels used as guests
qemu:
git: git://git.linaro.org/people/victor.kamensky/qemu-be.git
branch: armv7be-v1
description: changes to run qemu on armeb target; and other
changes to work with be image on top of be host
kvmtool:
git: git://git.linaro.org/people/victor.kamensky/linux-linaro-tracking-be.git
branch: kvmtool-armv7be-v1
description: minimal changes to build kvmtool for armeb target; and
tiny change with virtio magic
II) Mixed mode setup all possible combinations within V7 (LE guest on BE host;
BE guest on LE host as Marc's setup tested to make sure no regressions) only
with kvmtool.
This work is based on Marc Zyngier's work that made BE guest to run on top
of LE host. For this setup special version of kvmtool should be used and
in addition I had to apply patch to guest kernel that would switch reading
virtio configs reads to be LE only, that is made on top of previous Rusty
Russell's changes. Effectively I just had to do very minor addition to make
LE guest to work on BE host, most of heavy lifting was done before by Marc.
KVM host kernels: as in previous setup
Guest TC1 kernels with LE virtio config patch:
git: git://git.linaro.org/people/victor.kamensky/linux-linaro-tracking-be.git
branch: virtio-leconfig-3.13-rc4
kvmtool:
git: git://git.linaro.org/people/victor.kamensky/linux-linaro-tracking-be.git
branch: kvmtool-mixed-v1
description: based on git://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms.git
branch kvm-arm64/kvmtool-be-on-le; adds missing include fix; above armeb target
build patches; and one fix related to BE mode
qemu:
git: git://git.linaro.org/people/victor.kamensky/qemu-be.git
branch: armv7be-leconfig-v1
description: change virtio-blk that so qemu could work with guest image
where virtio leconfig is made; note it does not work in mixed mode; to do
so qemu would need bunch of similar changes that Marc did in kvmtool
Implement and enable context tracking for arm64 (which is
a prerequisite for FULL_NOHZ support). This patchset
builds upon earlier work by Kevin Hilman and is based on
Will Deacon's tree.
Changes v3 to v4:
* Rename parameter of ct_user_exit from save to restore
* Rebased patch to Will Deacon's tree (branch remotes/origin/aarch64
of git://git.kernel.org/pub/scm/linux/kernel/git/will/linux.git)
Changes v2 to v3:
* Save/restore necessary registers in ct_user_enter and ct_user_exit
* Annotate "error paths" out of el0_sync with ct_user_exit
Changes v1 to v2:
* Save far_el1 in x26 temporarily
Larry Bassel (2):
arm64: adjust el0_sync so that a function can be called
arm64: enable context tracking
arch/arm64/Kconfig | 1 +
arch/arm64/include/asm/thread_info.h | 1 +
arch/arm64/kernel/entry.S | 72 ++++++++++++++++++++++++++++++++----
3 files changed, 67 insertions(+), 7 deletions(-)
--
1.8.3.2
Hi Guys,
Here is another try to migrate clockevents to use set_dev_mode(). I have tried
to fix all issues raised by Kevin/Preeti/Daniel. Also some updates are done to
drivers to make sure they don't disable clockevents for unsupported modes, i.e.
'default' case.
Please do another round of review, it would be very helpful in getting these
through tglx.
@Kevin: I have updated my branch again, please see if you do another round of
automated tests for it.
Cover-letter for mainline:
A clockevent device can be stopped, or its events can be masked, if next event
is expected at KTIME_MAX, i.e. no events are required for very long time.
This normally happens with NO_HZ_FULL (when tick-sched timer is removed and we
don't have any more timers scheduled for long), not sure if it can happen
otherwise.
If we don't STOP clockevent device, we are guaranteed to receive atleast one
fake interrupt, as hrtimer_force_reprogram() isn't reprogramming the event
device. Depending on particular implementation of clockevent device, this can be
a fake interrupt at tick-rate.. (This was observed atleast on one
implementation: arm_arch_timer.c).
A simple solution to get this fixed could be: update hrtimer_force_reprogram()
to always reprogram clockevent device and update clockevent drivers to STOP
generating events (or delay it to max time), when 'expires' is set to KTIME_MAX.
But the drawback here is that every clockevent driver has to be hacked for this
particular case and its very easy for new ones to miss this.
Thomas suggested to add an optional mode: CLOCK_EVT_MODE_ONESHOT_STOPPED
(lkml.org/lkml/2014/5/9/508) to get tihs fixed.
This requires ->set_mode() callback to have capability to return 'success' or
'failure' for this new mode. Currently its return type is 'void'.
To change return type of set_mode() Thomas suggested to implement another
callback: ->set_dev_mode(), with return type 'int'. We can then convert
clockevent drivers to use this interface instead of existing ->set_mode() and
then finally remove ->set_mode()'s support.
This patchset first adds another callback with return capability,
set_dev_mode(), then it migrates all drivers one by one and finally removes
earlier callback set_mode() when nobody is using it.
Viresh Kumar (8):
clockevents: add ->set_dev_mode() to struct clock_event_device
clockevents: arm: migrate to ->set_dev_mode()
clockevents: mips: migrate to ->set_dev_mode()
clockevents: sparc: migrate to ->set_dev_mode()
clockevents: x86: migrate to ->set_dev_mode()
clockevents: drivers/: migrate to ->set_dev_mode()
clockevents: misc: migrate to ->set_dev_mode()
clockevents: remove ->set_mode() from struct clock_event_device
arch/alpha/kernel/time.c | 32 ++++++++++++++++++----
arch/arc/kernel/time.c | 11 +++++---
arch/arm/common/timer-sp.c | 13 +++++----
arch/arm/kernel/smp_twd.c | 10 ++++---
arch/arm/mach-at91/at91rm9200_time.c | 10 +++++--
arch/arm/mach-at91/at91sam926x_time.c | 11 ++++----
arch/arm/mach-clps711x/common.c | 12 ++++-----
arch/arm/mach-cns3xxx/core.c | 10 ++++---
arch/arm/mach-davinci/time.c | 7 +++--
arch/arm/mach-footbridge/dc21285-timer.c | 7 +++--
arch/arm/mach-gemini/time.c | 7 ++---
arch/arm/mach-imx/epit.c | 20 ++++++++------
arch/arm/mach-imx/time.c | 20 ++++++++------
arch/arm/mach-integrator/integrator_ap.c | 16 +++++------
arch/arm/mach-ixp4xx/common.c | 8 +++---
arch/arm/mach-ks8695/time.c | 22 ++++++++++-----
arch/arm/mach-lpc32xx/timer.c | 11 ++++----
arch/arm/mach-mmp/time.c | 12 +++++----
arch/arm/mach-netx/time.c | 16 +++++------
arch/arm/mach-omap1/time.c | 7 +++--
arch/arm/mach-omap1/timer32k.c | 11 ++++----
arch/arm/mach-omap2/timer.c | 12 +++++----
arch/arm/mach-pxa/time.c | 8 +++---
arch/arm/mach-sa1100/time.c | 8 +++---
arch/arm/mach-spear/time.c | 20 +++++++-------
arch/arm/mach-w90x900/time.c | 7 +++--
arch/arm/plat-iop/time.c | 8 +++---
arch/arm/plat-orion/time.c | 20 ++++++++++----
arch/avr32/kernel/time.c | 7 ++---
arch/blackfin/kernel/time-ts.c | 14 +++++++---
arch/c6x/platforms/timer64.c | 7 +++--
arch/hexagon/kernel/time.c | 11 +++++---
arch/m68k/platform/coldfire/pit.c | 7 +++--
arch/microblaze/kernel/timer.c | 7 +++--
arch/mips/alchemy/common/time.c | 14 ++++++++--
arch/mips/include/asm/cevt-r4k.h | 2 +-
arch/mips/jazz/irq.c | 14 ++++++++--
arch/mips/jz4740/time.c | 9 ++++---
arch/mips/kernel/cevt-bcm1480.c | 11 +++++---
arch/mips/kernel/cevt-ds1287.c | 12 ++++++---
arch/mips/kernel/cevt-gic.c | 14 ++++++++--
arch/mips/kernel/cevt-gt641xx.c | 12 ++++++---
arch/mips/kernel/cevt-r4k.c | 14 ++++++++--
arch/mips/kernel/cevt-sb1250.c | 11 +++++---
arch/mips/kernel/cevt-smtc.c | 2 +-
arch/mips/kernel/cevt-txx9.c | 12 ++++++---
arch/mips/loongson/common/cs5536/cs5536_mfgpt.c | 12 ++++-----
arch/mips/ralink/cevt-rt3352.c | 13 +++++----
arch/mips/sgi-ip27/ip27-timer.c | 14 ++++++++--
arch/mips/sni/time.c | 9 ++++---
arch/mn10300/kernel/cevt-mn10300.c | 14 ++++++++--
arch/openrisc/kernel/time.c | 11 ++++----
arch/powerpc/kernel/time.c | 16 ++++++++---
arch/s390/kernel/time.c | 14 ++++++++--
arch/score/kernel/time.c | 8 +++---
arch/sh/kernel/localtimer.c | 15 +++++++++--
arch/sparc/kernel/time_32.c | 18 ++++++++-----
arch/sparc/kernel/time_64.c | 11 ++++----
arch/tile/kernel/time.c | 16 ++++++++---
arch/um/kernel/time.c | 7 +++--
arch/unicore32/kernel/time.c | 8 +++---
arch/x86/kernel/apic/apic.c | 10 ++++---
arch/x86/kernel/hpet.c | 19 +++++++------
arch/x86/lguest/boot.c | 9 ++++---
arch/x86/platform/uv/uv_time.c | 10 ++++---
arch/x86/xen/time.c | 23 +++++++---------
arch/xtensa/kernel/time.c | 9 ++++---
drivers/clocksource/arm_arch_timer.c | 36 ++++++++++++++-----------
drivers/clocksource/arm_global_timer.c | 9 ++++---
drivers/clocksource/bcm2835_timer.c | 8 +++---
drivers/clocksource/bcm_kona_timer.c | 10 ++++---
drivers/clocksource/cadence_ttc_timer.c | 7 +++--
drivers/clocksource/cs5535-clockevt.c | 21 +++++++++++----
drivers/clocksource/dummy_timer.c | 15 +++++++++--
drivers/clocksource/dw_apb_timer.c | 7 +++--
drivers/clocksource/em_sti.c | 11 +++++---
drivers/clocksource/exynos_mct.c | 23 ++++++++++------
drivers/clocksource/i8253.c | 8 ++++--
drivers/clocksource/metag_generic.c | 11 ++++----
drivers/clocksource/moxart_timer.c | 8 +++---
drivers/clocksource/mxs_timer.c | 17 ++++++------
drivers/clocksource/nomadik-mtu.c | 7 +++--
drivers/clocksource/qcom-timer.c | 12 ++++-----
drivers/clocksource/samsung_pwm_timer.c | 13 ++++-----
drivers/clocksource/sh_cmt.c | 9 ++++---
drivers/clocksource/sh_mtu2.c | 9 ++++---
drivers/clocksource/sh_tmu.c | 9 ++++---
drivers/clocksource/sun4i_timer.c | 9 ++++---
drivers/clocksource/tcb_clksrc.c | 11 +++++---
drivers/clocksource/tegra20_timer.c | 12 +++++----
drivers/clocksource/time-armada-370-xp.c | 20 +++++++++-----
drivers/clocksource/time-efm32.c | 7 +++--
drivers/clocksource/time-orion.c | 17 +++++++++---
drivers/clocksource/timer-keystone.c | 9 ++++---
drivers/clocksource/timer-marco.c | 12 ++++++---
drivers/clocksource/timer-prima2.c | 10 +++----
drivers/clocksource/timer-sun5i.c | 10 ++++---
drivers/clocksource/timer-u300.c | 7 +++--
drivers/clocksource/vf_pit_timer.c | 12 ++++++---
drivers/clocksource/vt8500_timer.c | 8 +++---
drivers/clocksource/zevio-timer.c | 9 +++----
include/linux/clockchips.h | 4 +--
kernel/time/clockevents.c | 7 +++--
kernel/time/tick-broadcast-hrtimer.c | 11 +++++---
kernel/time/timer_list.c | 2 +-
105 files changed, 810 insertions(+), 419 deletions(-)
--
2.0.0.rc2
From: Viresh Kumar <viresh.kumar(a)linaro.org>
This patch has been added to the 3.12 stable tree. If you have any
objections, please let us know.
===============
commit 521c42990e9d561ed5ed9f501f07639d0512b3c9 upstream.
tick_check_replacement() returns if a replacement of clock_event_device is
possible or not. It does this as the first check:
if (tick_check_percpu(curdev, newdev, smp_processor_id()))
return false;
Thats wrong. tick_check_percpu() returns true when the device is
useable. Check for false instead.
[ tglx: Massaged changelog ]
Signed-off-by: Viresh Kumar <viresh.kumar(a)linaro.org>
Cc: linaro-kernel(a)lists.linaro.org
Cc: fweisbec(a)gmail.com
Cc: Arvind.Chauhan(a)arm.com
Cc: linaro-networking(a)linaro.org
Link: http://lkml.kernel.org/r/486a02efe0246635aaba786e24b42d316438bf3b.139753798…
Signed-off-by: Thomas Gleixner <tglx(a)linutronix.de>
Signed-off-by: Jiri Slaby <jslaby(a)suse.cz>
---
kernel/time/tick-common.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/time/tick-common.c b/kernel/time/tick-common.c
index 64522ecdfe0e..271ce26faa21 100644
--- a/kernel/time/tick-common.c
+++ b/kernel/time/tick-common.c
@@ -260,7 +260,7 @@ static bool tick_check_preferred(struct clock_event_device *curdev,
bool tick_check_replacement(struct clock_event_device *curdev,
struct clock_event_device *newdev)
{
- if (tick_check_percpu(curdev, newdev, smp_processor_id()))
+ if (!tick_check_percpu(curdev, newdev, smp_processor_id()))
return false;
return tick_check_preferred(curdev, newdev);
--
1.9.3
Hi David,
Do you have spare arndale board in hands? I am seeking a arndale board
for LSK debugging. I appreciated if anyone like send me a spare one.
--
Thanks
Alex
Hi, experts:
Linaro has released a 64bit kernel for ARMv8 FVP model.
So, how to compile it to Aarch32 bin?
I want to try to change boot wrapper code to switch to Aarch32 EL1
before jumping to kernel entrypoint.
So, I need to compile linux kernel to Aarch32 bin.
Best wishes,
Hi Frederic,
File: kernel/time/tick-sched.c
Function: tick_nohz_full_stop_tick()
We are doing this:
if (!tick_nohz_full_cpu(cpu) || is_idle_task(current))
return;
Which means: if a FULL_NO_HZ cpu is running idle task currently,
don't stop its tick..
I couldn't understand why. Can you please help here?
--
viresh
From: Chander Kashyap <k.chander(a)samsung.com>
We don't have any protection against addition of duplicate OPPs currently and in
case some code tries to add them, it will end up corrupting OPP tables.
We need to handle some duplication cases separately as returning error might not
be the right thing always. The new list of return values for dev_pm_opp_add()
are:
0: On success OR
Duplicate OPPs (both freq and volt are same) and opp->available
-EEXIST: Freq are same and volt are different OR
Duplicate OPPs (both freq and volt are same) and !opp->available
-ENOMEM: Memory allocation failure
Acked-by: Nishanth Menon <nm(a)ti.com>
Signed-off-by: Chander Kashyap <k.chander(a)samsung.com>
Signed-off-by: Inderpal Singh <inderpal.s(a)samsung.com>
Signed-off-by: Viresh Kumar <viresh.kumar(a)linaro.org>
---
I took some rest before sending V6, just to make sure I don't send another
version in hurry with any obvious mistake.
V5->V6:
- Remove parenthesis around initialization of 'ret'.
- s/Returns/Return
- Fix checkpatch.pl --strict warning: 'Alignment should match open parenthesis'
- Tried improving changelog..
drivers/base/power/opp.c | 27 +++++++++++++++++++++++++--
1 file changed, 25 insertions(+), 2 deletions(-)
diff --git a/drivers/base/power/opp.c b/drivers/base/power/opp.c
index faae9cf..89ced95 100644
--- a/drivers/base/power/opp.c
+++ b/drivers/base/power/opp.c
@@ -393,6 +393,13 @@ EXPORT_SYMBOL_GPL(dev_pm_opp_find_freq_floor);
* to keep the integrity of the internal data structures. Callers should ensure
* that this function is *NOT* called under RCU protection or in contexts where
* mutex cannot be locked.
+ *
+ * Return:
+ * 0: On success OR
+ * Duplicate OPPs (both freq and volt are same) and opp->available
+ * -EEXIST: Freq are same and volt are different OR
+ * Duplicate OPPs (both freq and volt are same) and !opp->available
+ * -ENOMEM: Memory allocation failure
*/
int dev_pm_opp_add(struct device *dev, unsigned long freq, unsigned long u_volt)
{
@@ -442,15 +449,31 @@ int dev_pm_opp_add(struct device *dev, unsigned long freq, unsigned long u_volt)
new_opp->u_volt = u_volt;
new_opp->available = true;
- /* Insert new OPP in order of increasing frequency */
+ /*
+ * Insert new OPP in order of increasing frequency
+ * and discard if already present
+ */
head = &dev_opp->opp_list;
list_for_each_entry_rcu(opp, &dev_opp->opp_list, node) {
- if (new_opp->rate < opp->rate)
+ if (new_opp->rate <= opp->rate)
break;
else
head = &opp->node;
}
+ /* Duplicate OPPs ? */
+ if (new_opp->rate == opp->rate) {
+ int ret = opp->available && new_opp->u_volt == opp->u_volt ?
+ 0 : -EEXIST;
+
+ dev_warn(dev, "%s: duplicate OPPs detected. Existing: freq: %lu, volt: %lu, enabled: %d. New: freq: %lu, volt: %lu, enabled: %d\n",
+ __func__, opp->rate, opp->u_volt, opp->available,
+ new_opp->rate, new_opp->u_volt, new_opp->available);
+ mutex_unlock(&dev_opp_list_lock);
+ kfree(new_opp);
+ return ret;
+ }
+
list_add_rcu(&new_opp->node, head);
mutex_unlock(&dev_opp_list_lock);
--
2.0.0.rc2
All drivers expecting CPU's OPPs from device tree initialize OPP table using
of_init_opp_table() and there is nothing driver specific in that. They all do it
in the same way adding to code redundancy.
It would be better if we can get rid of code redundancy by initializing CPU OPPs
from core code for all CPUs that have a "operating-points" property defined in
their node.
First patch initializes OPPs as soon as CPU device is registered in
register_cpu(). Following patches get rid of these calls from individual drivers
which are currently initializing OPPs.
The idea was initially discussed here: https://lkml.org/lkml/2014/5/17/123
Cc: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
Cc: Amit Daniel Kachhap <amit.daniel(a)samsung.com>
Cc: Kukjin Kim <kgene.kim(a)samsung.com>
Cc: Shawn Guo <shawn.guo(a)linaro.org>
Cc: Sudeep Holla <sudeep.holla(a)arm.com>
Viresh Kumar (5):
driver/core: cpu: initialize opp table
cpufreq: arm_big_little: don't initialize opp table
cpufreq: imx6q: don't initialize opp table
cpufreq: cpufreq-cpu0: don't initialize opp table
cpufreq: exynos5440: don't initialize opp table
arch/arm/mach-imx/mach-imx6q.c | 36 ++++++++----------------------------
drivers/base/cpu.c | 14 ++++++++++++--
drivers/cpufreq/arm_big_little.c | 12 +++++++-----
drivers/cpufreq/arm_big_little_dt.c | 18 ------------------
drivers/cpufreq/cpufreq-cpu0.c | 6 ------
drivers/cpufreq/exynos5440-cpufreq.c | 6 ------
drivers/cpufreq/imx6q-cpufreq.c | 20 +-------------------
7 files changed, 28 insertions(+), 84 deletions(-)
--
2.0.0.rc2
This is second attempt to initialize CPU's OPPs from CPU core code. First one
was here: https://lkml.org/lkml/2014/5/19/57
All drivers expecting CPU's OPPs from device tree initialize OPP table using
of_init_opp_table() and there is nothing driver specific in that. They all do it
in the same way adding to code redundancy.
It would be better if we can get rid of code redundancy by initializing CPU OPPs
from core code for all CPUs that have a "operating-points" property defined in
their node.
This patchset is all about that.
The idea was initially discussed here: https://lkml.org/lkml/2014/5/17/123
V1->V2:
- Addition of two new patches: 1/2 & 2/2
- Created separate routine of_init_cpu_opp_table() which wouldn't add any
overhead for the platforms which don't have OPP or OF enabled.
- Added a print for success case as well
- Added Acks from Shawn
- Got rid of extra indentation level by returning early from register_cpu().
Cc: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
Cc: Amit Daniel Kachhap <amit.daniel(a)samsung.com>
Cc: Kukjin Kim <kgene.kim(a)samsung.com>
Cc: Shawn Guo <shawn.guo(a)linaro.org>
Viresh Kumar (7):
opp: remove -ENOSYS from dummy implementation of of_init_opp_table()
opp: handle of_node_{get|put}() inside of_init_opp_table()
driver/core: cpu: initialize opp table
cpufreq: arm_big_little: don't initialize opp table
cpufreq: imx6q: don't initialize opp table
cpufreq: cpufreq-cpu0: don't initialize opp table
cpufreq: exynos5440: don't initialize opp table
arch/arm/mach-imx/mach-imx6q.c | 36 ++++++++----------------------------
drivers/base/cpu.c | 30 ++++++++++++++++++++++++++----
drivers/base/power/opp.c | 4 ++++
drivers/cpufreq/arm_big_little.c | 12 +++++++-----
drivers/cpufreq/arm_big_little_dt.c | 18 ------------------
drivers/cpufreq/cpufreq-cpu0.c | 6 ------
drivers/cpufreq/exynos5440-cpufreq.c | 6 ------
drivers/cpufreq/imx6q-cpufreq.c | 20 +-------------------
include/linux/pm_opp.h | 2 +-
9 files changed, 47 insertions(+), 87 deletions(-)
--
2.0.0.rc2
From: Chander Kashyap <k.chander(a)samsung.com>
We don't have any protection against addition of duplicate OPPs currently and
in case some code tries to add them it will end up corrupting OPP tables.
There can be many combinations in which we may end up trying duplicate OPPs:
- both freq and volt are same, but earlier OPP may or may not be active.
- only freq is same and volt is different.
This patch tries to implement below logic for these cases:
Return 0 if new OPP was duplicate of existing one (i.e. same freq and volt) and
return -EEXIST if new OPP had same freq but different volt as of an existing OPP
OR if both freq/volt were same but earlier OPP was disabled.
Signed-off-by: Chander Kashyap <k.chander(a)samsung.com>
Signed-off-by: Inderpal Singh <inderpal.s(a)samsung.com>
Signed-off-by: Viresh Kumar <viresh.kumar(a)linaro.org>
---
V4->V5:
- Mention Return values under 'Return:' clause of doc style comment.
- s/pr_warn/dev_warn
- s/linrao/linaro in my email id :(
drivers/base/power/opp.c | 27 +++++++++++++++++++++++++--
1 file changed, 25 insertions(+), 2 deletions(-)
diff --git a/drivers/base/power/opp.c b/drivers/base/power/opp.c
index 2553867..6a06d43 100644
--- a/drivers/base/power/opp.c
+++ b/drivers/base/power/opp.c
@@ -394,6 +394,13 @@ EXPORT_SYMBOL_GPL(dev_pm_opp_find_freq_floor);
* to keep the integrity of the internal data structures. Callers should ensure
* that this function is *NOT* called under RCU protection or in contexts where
* mutex cannot be locked.
+ *
+ * Returns:
+ * 0: On success OR
+ * Duplicate OPPs (both freq and volt are same) and opp->available
+ * -EEXIST: Freq are same and volt are different OR
+ * Duplicate OPPs (both freq and volt are same) and !opp->available
+ * -ENOMEM: Memory allocation failure
*/
int dev_pm_opp_add(struct device *dev, unsigned long freq, unsigned long u_volt)
{
@@ -443,15 +450,31 @@ int dev_pm_opp_add(struct device *dev, unsigned long freq, unsigned long u_volt)
new_opp->u_volt = u_volt;
new_opp->available = true;
- /* Insert new OPP in order of increasing frequency */
+ /*
+ * Insert new OPP in order of increasing frequency
+ * and discard if already present
+ */
head = &dev_opp->opp_list;
list_for_each_entry_rcu(opp, &dev_opp->opp_list, node) {
- if (new_opp->rate < opp->rate)
+ if (new_opp->rate <= opp->rate)
break;
else
head = &opp->node;
}
+ /* Duplicate OPPs ? */
+ if (new_opp->rate == opp->rate) {
+ int ret = (new_opp->u_volt == opp->u_volt) && opp->available ?
+ 0 : -EEXIST;
+
+ dev_warn(dev, "%s: duplicate OPPs detected. Existing: freq: %lu, volt: %lu, enabled: %d. New: freq: %lu, volt: %lu, enabled: %d\n",
+ __func__, opp->rate, opp->u_volt, opp->available,
+ new_opp->rate, new_opp->u_volt, new_opp->available);
+ mutex_unlock(&dev_opp_list_lock);
+ kfree(new_opp);
+ return ret;
+ }
+
list_add_rcu(&new_opp->node, head);
mutex_unlock(&dev_opp_list_lock);
--
2.0.0.rc2