linux-stable/drivers/clocksource
Roman Volkov f9eccf2461 clocksource/drivers/vt8500: Increase the minimum delta
The vt8500 clocksource driver declares itself as capable to handle the
minimum delay of 4 cycles by passing the value into
clockevents_config_and_register(). The vt8500_timer_set_next_event()
requires the passed cycles value to be at least 16. The impact is that
userspace hangs in nanosleep() calls with small delay intervals.

This problem is reproducible in Linux 4.2 starting from:
c6eb3f70d4 ('hrtimer: Get rid of hrtimer softirq')

From Russell King, more detailed explanation:

"It's a speciality of the StrongARM/PXA hardware. It takes a certain
number of OSCR cycles for the value written to hit the compare registers.
So, if a very small delta is written (eg, the compare register is written
with a value of OSCR + 1), the OSCR will have incremented past this value
before it hits the underlying hardware. The result is, that you end up
waiting a very long time for the OSCR to wrap before the event fires.

So, we introduce a check in set_next_event() to detect this and return
-ETIME if the calculated delta is too small, which causes the generic
clockevents code to retry after adding the min_delta specified in
clockevents_config_and_register() to the current time value.

min_delta must be sufficient that we don't re-trip the -ETIME check - if
we do, we will return -ETIME, forward the next event time, try to set it,
return -ETIME again, and basically lock the system up. So, min_delta
must be larger than the check inside set_next_event(). A factor of two
was chosen to ensure that this situation would never occur.

The PXA code worked on PXA systems for years, and I'd suggest no one
changes this mechanism without access to a wide range of PXA systems,
otherwise they're risking breakage."

Cc: stable@vger.kernel.org
Cc: Russell King <linux@arm.linux.org.uk>
Acked-by: Alexey Charkov <alchark@gmail.com>
Signed-off-by: Roman Volkov <rvolkov@v1ros.org>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
2016-01-11 22:49:07 +01:00
..
acpi_pm.c treewide: Fix printks with 0x%# 2013-08-27 10:49:38 +02:00
arm_arch_timer.c clocksource / arm_arch_timer: Convert to ACPI probing 2015-10-01 02:18:39 +02:00
arm_global_timer.c clocksource/drivers/arm_global_timer: Prevent ftrace recursion 2015-10-27 01:32:33 +01:00
armv7m_systick.c clocksource/drivers/armv7m_systick: Add ARM System timer driver 2015-06-02 12:10:14 +02:00
asm9260_timer.c clockevents/drivers/asm9260: Migrate to new 'set-state' interface 2015-08-10 11:40:25 +02:00
bcm2835_timer.c clockevents/drivers/bcm2835: Migrate to new 'set-state' interface 2015-08-06 12:16:41 +02:00
bcm_kona_timer.c clockevents/drivers/bcm_kona: Migrate to new 'set-state' interface 2015-08-06 12:16:42 +02:00
cadence_ttc_timer.c Merge branch 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2015-09-01 14:04:50 -07:00
clksrc-dbx500-prcmu.c clocksource: dbx500-prcmu: Switch to sched_clock_register() 2013-07-30 11:24:52 -07:00
clksrc-probe.c clocksource: cosmetic: Drop OF 'dependency' from symbols 2015-10-01 02:18:39 +02:00
clksrc_st_lpc.c clocksource: sti: Provide 'use timer as sched clock' capability 2015-07-23 17:07:26 +01:00
clps711x-timer.c clockevents/drivers/clps711x: Migrate to new 'set-state' interface 2015-08-10 11:40:27 +02:00
cs5535-clockevt.c clockevents/drivers/cs5535: Migrate to new 'set-state' interface 2015-08-06 12:16:42 +02:00
dummy_timer.c clockevents/drivers/dummy_timer: Migrate to new 'set-state' interface 2015-08-10 11:40:28 +02:00
dw_apb_timer.c clockevents/drivers/dw_apb_timer: Add dynamic irq flag to the timer 2015-08-10 11:40:53 +02:00
dw_apb_timer_of.c clocksource/drivers/dw_apb_timers_of: Fix IO endianness causing time jumps 2015-03-31 09:15:57 +02:00
em_sti.c clocksource/drivers/em_sti: Remove unneeded memset()s 2015-10-15 17:41:59 +02:00
exynos_mct.c clocksource/drivers/exynos_mct: Use container_of() instead of this_cpu_ptr() 2015-10-15 17:42:03 +02:00
fsl_ftm_timer.c clocksource/fsl: Avoid harmless 64-bit warnings 2015-11-16 19:07:08 +01:00
h8300_timer8.c clocksource/drivers/h8300_*: Remove unneeded memset()s 2015-10-15 17:42:02 +02:00
h8300_timer16.c clocksource/drivers/h8300_*: Remove unneeded memset()s 2015-10-15 17:42:02 +02:00
h8300_tpu.c clocksource/drivers/h8300_*: Remove unneeded memset()s 2015-10-15 17:42:02 +02:00
i8253.c clockevents/drivers/i8253: Migrate to new 'set-state' interface 2015-08-10 11:40:30 +02:00
Kconfig clocksource: Disallow drivers for ARCH_USES_GETTIMEOFFSET 2015-11-16 19:07:08 +01:00
Makefile ARM: SoC cleanups for v4.4 2015-11-10 14:48:36 -08:00
meson6_timer.c clockevents/drivers/meson6: Migrate to new 'set-state' interface 2015-08-10 11:40:30 +02:00
metag_generic.c clockevents/drivers/metag_generic: Migrate to new 'set-state' interface 2015-08-10 11:40:31 +02:00
mips-gic-timer.c MIPS: VDSO: Add implementations of gettimeofday() and clock_gettime() 2015-11-11 08:36:41 +01:00
mmio.c clocksource: Mmio: remove artificial 32bit limitation 2015-12-10 19:37:18 +01:00
moxart_timer.c clockevents/drivers/moxart: Migrate to new 'set-state' interface 2015-08-10 11:40:32 +02:00
mtk_timer.c clocksource/drivers/mediatek: Use GPT as sched clock source 2015-10-15 17:41:58 +02:00
mxs_timer.c clockevents/drivers/mxs: Migrate to new 'set-state' interface 2015-08-10 11:40:34 +02:00
nomadik-mtu.c clockevents/drivers/nomadik-mtu: Migrate to new 'set-state' interface 2015-08-10 11:40:34 +02:00
numachip.c x86/numachip: Fix timer build conflict 2015-09-23 05:39:20 +02:00
pxa_timer.c clockevents/drivers/pxa: Migrate to new 'set-state' interface 2015-08-10 11:40:35 +02:00
qcom-timer.c clockevents/drivers/qcom: Migrate to new 'set-state' interface 2015-08-10 11:40:36 +02:00
rockchip_timer.c clocksource/drivers/rockchip: Fix bad NO_IRQ usage 2015-09-29 14:33:34 +02:00
samsung_pwm_timer.c clocksource/drivers/samsung_pwm_timer: Prevent ftrace recursion 2015-10-27 01:33:41 +01:00
scx200_hrt.c
sh_cmt.c clocksource/drivers/sh_cmt: Remove unneeded memset() in sh_cmt_setup() 2015-10-15 17:42:00 +02:00
sh_mtu2.c clocksource/drivers/sh_mtu2: Fix multiple shutdown call issue 2015-10-28 15:22:56 +01:00
sh_tmu.c clocksource/drivers/sh_tmu: Fix traceback spotted in -next 2015-08-10 11:40:57 +02:00
sun4i_timer.c clockevents/drivers/sun4i: Migrate to new 'set-state' interface 2015-08-10 11:40:40 +02:00
tango_xtal.c clocksource/drivers/tango_xtal: Add new timer for Tango SoCs 2015-10-16 14:09:57 +02:00
tcb_clksrc.c misc: atmel_tclib: get and use slow clock 2015-10-06 12:33:14 +02:00
tegra20_timer.c clockevents/drivers/tegra20: Migrate to new 'set-state' interface 2015-08-10 11:40:40 +02:00
time-armada-370-xp.c clocksource/drivers/armada-370-xp: Implement ARM delay timer 2015-10-19 22:42:14 +02:00
time-efm32.c clockevents/drivers/efm32: Migrate to new 'set-state' interface 2015-08-10 11:40:42 +02:00
time-lpc32xx.c clocksource/drivers/lpc32xx: Add the lpc32xx timer driver 2015-06-02 12:10:10 +02:00
time-orion.c clockevents/drivers/orion: Migrate to new 'set-state' interface 2015-08-10 11:40:42 +02:00
time-pistachio.c clocksource/drivers/pistachio: Prevent ftrace recursion 2015-10-27 01:33:18 +01:00
timer-atlas7.c clockevents/drivers/atlas7: Migrate to new 'set-state' interface 2015-08-10 11:40:43 +02:00
timer-atmel-pit.c clockevents/drivers/timer-atmel-pit: Fix typo in structure initialization 2015-08-10 11:40:56 +02:00
timer-atmel-st.c clocksource: atmel-st: get and use slow clock 2015-10-06 12:25:11 +02:00
timer-digicolor.c clocksource/drivers/digicolor: Prevent ftrace recursion 2015-10-27 01:34:17 +01:00
timer-imx-gpt.c clocksource/drivers/imx: Allow timer irq affinity change 2015-10-15 17:42:05 +02:00
timer-integrator-ap.c clockevents/drivers/integrator: Migrate to new 'set-state' interface 2015-08-10 11:40:46 +02:00
timer-keystone.c clocksource/drivers/keystone: Fix bad NO_IRQ usage 2015-09-29 14:33:51 +02:00
timer-prima2.c clocksource/drivers/prima2: Prevent ftrace recursion 2015-10-27 01:33:50 +01:00
timer-sp.h ARM: 8366/1: move Dual-Timer SP804 driver to drivers/clocksource 2015-06-02 09:58:18 +01:00
timer-sp804.c clockevents/drivers/timer-sp804: Migrate to new 'set-state' interface 2015-08-10 11:40:55 +02:00
timer-stm32.c clockevents/drivers/stm32: Migrate to new 'set-state' interface 2015-08-10 11:40:48 +02:00
timer-sun5i.c clockevents/drivers/sun5i: Migrate to new 'set-state' interface 2015-08-10 11:40:49 +02:00
timer-ti-32k.c clocksource: add TI 32.768 Hz counter driver 2015-10-16 11:06:24 -05:00
timer-u300.c clockevents/drivers/u300: Migrate to new 'set-state' interface 2015-08-10 11:40:49 +02:00
versatile.c clocksource: versatile: Adapt for Versatile AB and PB boards 2015-01-29 14:02:16 +01:00
vf_pit_timer.c clocksource/drivers/vf_pit_timer: Prevent ftrace recursion 2015-10-27 01:33:58 +01:00
vt8500_timer.c clocksource/drivers/vt8500: Increase the minimum delta 2016-01-11 22:49:07 +01:00
zevio-timer.c clockevents/drivers/zevio: Migrate to new 'set-state' interface 2015-08-10 11:40:51 +02:00