diff options
author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2009-09-21 09:30:09 +0200 |
---|---|---|
committer | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2010-01-22 17:04:39 +0100 |
commit | 501d70383aa9ffc78b41aa7e74f6b0254c7c731c (patch) | |
tree | b0a9421468f16aabff7ff8e92cf1655d17ef7eef /arch/arm/mach-at91/at91rm9200_time.c | |
parent | 066000dd856709b6980123eb39b957fe26993f7b (diff) | |
download | kernel_samsung_aries-501d70383aa9ffc78b41aa7e74f6b0254c7c731c.zip kernel_samsung_aries-501d70383aa9ffc78b41aa7e74f6b0254c7c731c.tar.gz kernel_samsung_aries-501d70383aa9ffc78b41aa7e74f6b0254c7c731c.tar.bz2 |
arm/at91: Don't disable irqs in set_next_event and set_mode callbacks
on AT91 the timer irq is shared, so the handler might be entered without
irqs being disabled. Though this should not happen as the timer irq is
registered early, there have been some reports on the mailing list.
To make debugging that problem easier next time it pops up a
WARN_ON_ONCE is added to the handler if irqs are not off.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Diffstat (limited to 'arch/arm/mach-at91/at91rm9200_time.c')
-rw-r--r-- | arch/arm/mach-at91/at91rm9200_time.c | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/arch/arm/mach-at91/at91rm9200_time.c b/arch/arm/mach-at91/at91rm9200_time.c index 309f351..2500f41 100644 --- a/arch/arm/mach-at91/at91rm9200_time.c +++ b/arch/arm/mach-at91/at91rm9200_time.c @@ -58,6 +58,12 @@ static irqreturn_t at91rm9200_timer_interrupt(int irq, void *dev_id) { u32 sr = at91_sys_read(AT91_ST_SR) & irqmask; + /* + * irqs should be disabled here, but as the irq is shared they are only + * guaranteed to be off if the timer irq is registered first. + */ + WARN_ON_ONCE(!irqs_disabled()); + /* simulate "oneshot" timer with alarm */ if (sr & AT91_ST_ALMS) { clkevt.event_handler(&clkevt); @@ -132,24 +138,11 @@ clkevt32k_mode(enum clock_event_mode mode, struct clock_event_device *dev) static int clkevt32k_next_event(unsigned long delta, struct clock_event_device *dev) { - unsigned long flags; u32 alm; int status = 0; BUG_ON(delta < 2); - /* Use "raw" primitives so we behave correctly on RT kernels. */ - raw_local_irq_save(flags); - - /* - * According to Thomas Gleixner irqs are already disabled here. Simply - * removing raw_local_irq_save above (and the matching - * raw_local_irq_restore) was not accepted. See - * http://thread.gmane.org/gmane.linux.ports.arm.kernel/41174 - * So for now (2008-11-20) just warn once if irqs were not disabled ... - */ - WARN_ON_ONCE(!raw_irqs_disabled_flags(flags)); - /* The alarm IRQ uses absolute time (now+delta), not the relative * time (delta) in our calling convention. Like all clockevents * using such "match" hardware, we have a race to defend against. @@ -169,7 +162,6 @@ clkevt32k_next_event(unsigned long delta, struct clock_event_device *dev) alm += delta; at91_sys_write(AT91_ST_RTAR, alm); - raw_local_irq_restore(flags); return status; } |