linux-stable/drivers/clocksource
Serge Semin a49fdcefa9 clocksource: dw_apb_timer_of: Fix missing clockevent timers
[ Upstream commit 6d2e16a318 ]

Commit 1002148899 ("clocksource: dw_apb_timer_of: use
clocksource_of_init") replaced a publicly available driver
initialization method with one called by the timer_probe() method
available after CLKSRC_OF. In current implementation it traverses
all the timers available in the system and calls their initialization
methods if corresponding devices were either in dtb or in acpi. But
if before the commit any number of available timers would be installed
as clockevent and clocksource devices, after that there would be at most
two. The rest are just ignored since default case branch doesn't do
anything. I don't see a reason of such behaviour, neither the commit
message explains it. Moreover this might be wrong if on some platforms
these timers might be used for different purpose, as virtually CPU-local
clockevent timers and as an independent broadcast timer. So in order
to keep the compatibility with the platforms where the order of the
timers detection has some meaning, lets add the secondly discovered
timer to be of clocksource/sched_clock type, while the very first and
the others would provide the clockevents service.

Fixes: 1002148899 ("clocksource: dw_apb_timer_of: use clocksource_of_init")
Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>
Cc: Alexey Malahov <Alexey.Malahov@baikalelectronics.ru>
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc: Paul Burton <paulburton@kernel.org>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Rob Herring <robh+dt@kernel.org>
Cc: linux-mips@vger.kernel.org
Cc: linux-rtc@vger.kernel.org
Cc: devicetree@vger.kernel.org
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Link: https://lore.kernel.org/r/20200521204818.25436-7-Sergey.Semin@baikalelectronics.ru
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-06-20 10:25:08 +02:00
..
acpi_pm.c
arc_timer.c
arm_arch_timer.c
arm_global_timer.c
armv7m_systick.c
asm9260_timer.c clocksource/drivers/asm9260: Add a check for of_clk_get 2020-01-04 13:59:40 +01:00
bcm2835_timer.c clocksource/drivers/bcm2835_timer: Fix memory leak of timer 2020-02-28 16:35:57 +01:00
bcm_kona_timer.c
cadence_ttc_timer.c
clksrc-dbx500-prcmu.c
clksrc_st_lpc.c
clps711x-timer.c
cs5535-clockevt.c
dummy_timer.c
dw_apb_timer.c clocksource: dw_apb_timer: Make CPU-affiliation being optional 2020-06-20 10:25:08 +02:00
dw_apb_timer_of.c clocksource: dw_apb_timer_of: Fix missing clockevent timers 2020-06-20 10:25:08 +02:00
em_sti.c
exynos_mct.c clocksource/drivers/exynos_mct: Fix error path in timer resources initialization 2020-01-27 14:46:21 +01:00
fsl_ftm_timer.c
h8300_timer8.c
h8300_timer16.c
h8300_tpu.c
i8253.c clockevents/drivers/i8253: Add support for PIT shutdown quirk 2018-11-21 09:24:11 +01:00
jcore-pit.c
Kconfig
Makefile
meson6_timer.c
metag_generic.c
mips-gic-timer.c
mmio.c
mps2-timer.c
mtk_timer.c
mxs_timer.c
nomadik-mtu.c
numachip.c
owl-timer.c
pxa_timer.c
qcom-timer.c
renesas-ostm.c
rockchip_timer.c
samsung_pwm_timer.c
scx200_hrt.c
sh_cmt.c clocksource/drivers/sh_cmt: Fix clocksource width for 32-bit machines 2019-11-24 08:23:03 +01:00
sh_mtu2.c
sh_tmu.c
sun4i_timer.c
tango_xtal.c
tcb_clksrc.c
tegra20_timer.c
time-armada-370-xp.c
time-efm32.c
time-lpc32xx.c
time-orion.c
time-pistachio.c
timer-atlas7.c
timer-atmel-pit.c
timer-atmel-st.c
timer-digicolor.c
timer-fttmr010.c clocksource/drivers/fttmr010: Fix invalid interrupt register access 2019-12-05 15:37:34 +01:00
timer-imx-gpt.c
timer-imx-tpm.c
timer-integrator-ap.c clocksource/drivers/integrator-ap: Add missing of_node_put() 2019-01-26 09:37:05 +01:00
timer-keystone.c
timer-nps.c
timer-of.c
timer-of.h
timer-oxnas-rps.c clocksource/drivers/oxnas: Fix OX820 compatible 2019-05-16 19:42:21 +02:00
timer-prima2.c
timer-probe.c
timer-sp.h
timer-sp804.c
timer-stm32.c
timer-sun5i.c clocksource/drivers/sun5i: Fail gracefully when clock rate is unavailable 2020-01-27 14:46:21 +01:00
timer-ti-32k.c clocksource/drivers/ti-32k: Add CLOCK_SOURCE_SUSPEND_NONSTOP flag for non-am43 SoCs 2018-10-20 09:48:49 +02:00
timer-u300.c
versatile.c
vf_pit_timer.c
vt8500_timer.c
zevio-timer.c