linux/drivers/clocksource
Magnus Damm fe326c5cc0 clocksource/drivers/sh_mtu2: Fix multiple shutdown call issue
On the r7s72100 Genmai board the MTU2 driver currently triggers a common
clock framework WARN_ON(enable_count) when disabling the clock due to
the MTU2 driver after recent callback rework may call ->set_state_shutdown()
multiple times. A similar issue was spotted for the TMU driver and fixed in:
452b132 clocksource/drivers/sh_tmu: Fix traceback spotted in -next

On r7s72100 Genmai v4.3-rc7 built with shmobile_defconfig spits out the
following during boot:

sh_mtu2 fcff0000.timer: ch0: used for clock events
------------[ cut here ]------------
WARNING: CPU: 0 PID: 1 at drivers/clk/clk.c:675 clk_core_disable+0x2c/0x6c()
CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.3.0-rc7 #1
Hardware name: Generic R7S72100 (Flattened Device Tree)
Backtrace:
[<c00133d4>] (dump_backtrace) from [<c0013570>] (show_stack+0x18/0x1c)
[<c0013558>] (show_stack) from [<c01c7aac>] (dump_stack+0x74/0x90)
[<c01c7a38>] (dump_stack) from [<c00272fc>] (warn_slowpath_common+0x88/0xb4)
[<c0027274>] (warn_slowpath_common) from [<c0027400>] (warn_slowpath_null+0x24/0x2c)
[<c00273dc>] (warn_slowpath_null) from [<c03a9320>] (clk_core_disable+0x2c/0x6c)
[<c03a92f4>] (clk_core_disable) from [<c03aa0a0>] (clk_disable+0x40/0x4c)
[<c03aa060>] (clk_disable) from [<c0395d2c>] (sh_mtu2_disable+0x24/0x50)
[<c0395d08>] (sh_mtu2_disable) from [<c0395d6c>] (sh_mtu2_clock_event_shutdown+0x14/0x1c)
[<c0395d58>] (sh_mtu2_clock_event_shutdown) from [<c007d7d0>] (clockevents_switch_state+0xc8/0x114)
[<c007d708>] (clockevents_switch_state) from [<c007d834>] (clockevents_shutdown+0x18/0x28)
[<c007d81c>] (clockevents_shutdown) from [<c007dd58>] (clockevents_exchange_device+0x70/0x78)
[<c007dce8>] (clockevents_exchange_device) from [<c007e578>] (tick_check_new_device+0x88/0xe0)
[<c007e4f0>] (tick_check_new_device) from [<c007daf0>] (clockevents_register_device+0xac/0x120)
[<c007da44>] (clockevents_register_device) from [<c0395be8>] (sh_mtu2_probe+0x230/0x350)
[<c03959b8>] (sh_mtu2_probe) from [<c028b6f0>] (platform_drv_probe+0x50/0x98)

Reported-by: Chris Brandt <chris.brandt@renesas.com>
Fixes: 19a9ffb ("clockevents/drivers/sh_mtu2: Migrate to new 'set-state' interface")
Cc: Viresh Kumar <viresh.kumar@linaro.org>
Cc: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Magnus Damm <damm+renesas@opensource.se>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org>
2015-10-28 15:22:56 +01:00
..
acpi_pm.c treewide: Fix printks with 0x%# 2013-08-27 10:49:38 +02:00
arm_arch_timer.c clockevents/drivers/arm_arch_timer: Migrate to new 'set-state' interface 2015-08-06 12:16:41 +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_st_lpc.c clocksource: sti: Provide 'use timer as sched clock' capability 2015-07-23 17:07:26 +01:00
clksrc-dbx500-prcmu.c clocksource: dbx500-prcmu: Switch to sched_clock_register() 2013-07-30 11:24:52 -07:00
clksrc-of.c of: consolidate linker section OF match table declarations 2014-05-20 14:25:24 -05: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_of.c clocksource/drivers/dw_apb_timers_of: Fix IO endianness causing time jumps 2015-03-31 09:15:57 +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
em_sti.c clockevents/drivers/em_sti: Migrate to new 'set-state' interface 2015-08-06 12:16:42 +02:00
exynos_mct.c clockevents/drivers/exynos_mct: Migrate to new 'set-state' interface 2015-08-10 11:40:53 +02:00
fsl_ftm_timer.c clocksource/drivers/fsl_ftm_timer: Prevent ftrace recursion 2015-10-27 01:34:07 +01:00
h8300_timer8.c clockevents/drivers/h8300_timer8: Migrate to new 'set-state' interface 2015-08-10 11:40:58 +02:00
h8300_timer16.c h8300: clocksource 2015-06-23 13:35:55 +09:00
h8300_tpu.c h8300: clocksource 2015-06-23 13:35:55 +09:00
i8253.c clockevents/drivers/i8253: Migrate to new 'set-state' interface 2015-08-10 11:40:30 +02:00
Kconfig - New Device Support 2015-09-04 11:35:03 -07:00
Makefile - New Device Support 2015-09-04 11:35:03 -07: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 Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus 2015-09-03 16:55:55 -07:00
mmio.c clocksource: Fix clocksource_mmio_readX_down 2014-05-23 09:19:40 +02:00
moxart_timer.c clockevents/drivers/moxart: Migrate to new 'set-state' interface 2015-08-10 11:40:32 +02:00
mtk_timer.c clockevents/drivers/mtk: Migrate to new 'set-state' interface 2015-08-10 11:40:33 +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
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 clocksource: scx200_hrt: Fix the build 2012-02-22 13:25:16 +01:00
sh_cmt.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
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
tcb_clksrc.c clockevents/drivers/tcb_clksrc: Migrate to new 'set-state' interface 2015-08-10 11:40:52 +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 clockevents/drivers/time-armada-370-xp: Migrate to new 'set-state' interface 2015-08-10 11:40:41 +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 clockevents/drivers/atmel-st: Migrate to new 'set-state' interface 2015-08-10 11:40:44 +02:00
timer-digicolor.c clocksource/drivers/digicolor: Prevent ftrace recursion 2015-10-27 01:34:17 +01:00
timer-imx-gpt.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
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-sp804.c clockevents/drivers/timer-sp804: Migrate to new 'set-state' interface 2015-08-10 11:40:55 +02:00
timer-sp.h ARM: 8366/1: move Dual-Timer SP804 driver to drivers/clocksource 2015-06-02 09:58:18 +01: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-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 clockevents/drivers/vt8500: Migrate to new 'set-state' interface 2015-08-10 11:40:51 +02:00
zevio-timer.c clockevents/drivers/zevio: Migrate to new 'set-state' interface 2015-08-10 11:40:51 +02:00