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