sh: turn off irqs when disabling CMT/TMU timers
authorMagnus Damm <damm@igel.co.jp>
Wed, 17 Jun 2009 05:04:04 +0000 (05:04 +0000)
committerPaul Mundt <lethal@linux-sh.org>
Wed, 17 Jun 2009 06:39:56 +0000 (15:39 +0900)
Modify the CMT and TMU drivers to disable interrupts when
disabling the timer. Only using start/stop bits is not
enough.

This fixes a bootup hang on Migo-R when the CMT is replaced
by TMU for clockevents but the CMT keeps on delivering irqs
even though the timer start bit is off.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
drivers/clocksource/sh_cmt.c
drivers/clocksource/sh_tmu.c

index 7135f50082d673d835e591e47ca3e2356fe5e84f..2964f5f4a7ef3348104044f008992d22b08b55b1 100644 (file)
@@ -184,6 +184,9 @@ static void sh_cmt_disable(struct sh_cmt_priv *p)
        /* disable channel */
        sh_cmt_start_stop_ch(p, 0);
 
+       /* disable interrupts in CMT block */
+       sh_cmt_write(p, CMCSR, 0);
+
        /* stop clock */
        clk_disable(p->clk);
 }
index 08e6ec2cb0946ee883c515d9fbf78e09cc6290a8..9ffb05f4095d7598c6b8fc8e37bc55cae96ae2b6 100644 (file)
@@ -138,6 +138,9 @@ static void sh_tmu_disable(struct sh_tmu_priv *p)
        /* disable channel */
        sh_tmu_start_stop_ch(p, 0);
 
+       /* disable interrupts in TMU block */
+       sh_tmu_write(p, TCR, 0x0000);
+
        /* stop clock */
        clk_disable(p->clk);
 }