sh: turn off irqs when disabling CMT/TMU timers

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linux Kernel Mailing List
Date: Thursday, June 18, 2009 - 3:04 pm

Gitweb:     http://git.kernel.org/linus/be890a1a95fb439594e796f1968f86ee9f36e718
Commit:     be890a1a95fb439594e796f1968f86ee9f36e718
Parent:     4c7eb4ebc9001ce343969f58fa538e164e82000b
Author:     Magnus Damm <damm@igel.co.jp>
AuthorDate: Wed Jun 17 05:04:04 2009 +0000
Committer:  Paul Mundt <lethal@linux-sh.org>
CommitDate: Wed Jun 17 15:39:56 2009 +0900

    sh: turn off irqs when disabling CMT/TMU timers
    
    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 |    3 +++
 drivers/clocksource/sh_tmu.c |    3 +++
 2 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/drivers/clocksource/sh_cmt.c b/drivers/clocksource/sh_cmt.c
index 7135f50..2964f5f 100644
--- a/drivers/clocksource/sh_cmt.c
+++ b/drivers/clocksource/sh_cmt.c
@@ -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);
 }
diff --git a/drivers/clocksource/sh_tmu.c b/drivers/clocksource/sh_tmu.c
index 08e6ec2..9ffb05f 100644
--- a/drivers/clocksource/sh_tmu.c
+++ b/drivers/clocksource/sh_tmu.c
@@ -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);
 }
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
sh: turn off irqs when disabling CMT/TMU timers, Linux Kernel Mailing ..., (Thu Jun 18, 3:04 pm)