From 26c671c6b7c02bc9f9c42331e6ecbeccdf67164c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Uwe=20Kleine-K=C3=B6nig?= Date: Thu, 19 Jul 2007 22:13:05 +0100 Subject: [PATCH] [ARM] 4493/1: ns9xxx: disable a non-reloading timer before ack'ing its irq MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit The HRM states that is must be done this way ... Signed-off-by: Uwe Kleine-König Signed-off-by: Russell King --- arch/arm/mach-ns9xxx/irq.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/arch/arm/mach-ns9xxx/irq.c b/arch/arm/mach-ns9xxx/irq.c index cd8f8365b6..b8c7b00522 100644 --- a/arch/arm/mach-ns9xxx/irq.c +++ b/arch/arm/mach-ns9xxx/irq.c @@ -21,6 +21,15 @@ static void ns9xxx_ack_irq_timer(unsigned int irq) { u32 tc = SYS_TC(irq - IRQ_TIMER0); + /* + * If the timer is programmed to halt on terminal count, the + * timer must be disabled before clearing the interrupt. + */ + if (REGGET(tc, SYS_TCx, REN) == 0) { + REGSET(tc, SYS_TCx, TEN, DIS); + SYS_TC(irq - IRQ_TIMER0) = tc; + } + REGSET(tc, SYS_TCx, INTC, SET); SYS_TC(irq - IRQ_TIMER0) = tc; -- 2.39.5