diff options
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 309f3511aa2..2500f41d8d2 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) | |||
58 | { | 58 | { |
59 | u32 sr = at91_sys_read(AT91_ST_SR) & irqmask; | 59 | u32 sr = at91_sys_read(AT91_ST_SR) & irqmask; |
60 | 60 | ||
61 | /* | ||
62 | * irqs should be disabled here, but as the irq is shared they are only | ||
63 | * guaranteed to be off if the timer irq is registered first. | ||
64 | */ | ||
65 | WARN_ON_ONCE(!irqs_disabled()); | ||
66 | |||
61 | /* simulate "oneshot" timer with alarm */ | 67 | /* simulate "oneshot" timer with alarm */ |
62 | if (sr & AT91_ST_ALMS) { | 68 | if (sr & AT91_ST_ALMS) { |
63 | clkevt.event_handler(&clkevt); | 69 | clkevt.event_handler(&clkevt); |
@@ -132,24 +138,11 @@ clkevt32k_mode(enum clock_event_mode mode, struct clock_event_device *dev) | |||
132 | static int | 138 | static int |
133 | clkevt32k_next_event(unsigned long delta, struct clock_event_device *dev) | 139 | clkevt32k_next_event(unsigned long delta, struct clock_event_device *dev) |
134 | { | 140 | { |
135 | unsigned long flags; | ||
136 | u32 alm; | 141 | u32 alm; |
137 | int status = 0; | 142 | int status = 0; |
138 | 143 | ||
139 | BUG_ON(delta < 2); | 144 | BUG_ON(delta < 2); |
140 | 145 | ||
141 | /* Use "raw" primitives so we behave correctly on RT kernels. */ | ||
142 | raw_local_irq_save(flags); | ||
143 | |||
144 | /* | ||
145 | * According to Thomas Gleixner irqs are already disabled here. Simply | ||
146 | * removing raw_local_irq_save above (and the matching | ||
147 | * raw_local_irq_restore) was not accepted. See | ||
148 | * http://thread.gmane.org/gmane.linux.ports.arm.kernel/41174 | ||
149 | * So for now (2008-11-20) just warn once if irqs were not disabled ... | ||
150 | */ | ||
151 | WARN_ON_ONCE(!raw_irqs_disabled_flags(flags)); | ||
152 | |||
153 | /* The alarm IRQ uses absolute time (now+delta), not the relative | 146 | /* The alarm IRQ uses absolute time (now+delta), not the relative |
154 | * time (delta) in our calling convention. Like all clockevents | 147 | * time (delta) in our calling convention. Like all clockevents |
155 | * using such "match" hardware, we have a race to defend against. | 148 | * 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) | |||
169 | alm += delta; | 162 | alm += delta; |
170 | at91_sys_write(AT91_ST_RTAR, alm); | 163 | at91_sys_write(AT91_ST_RTAR, alm); |
171 | 164 | ||
172 | raw_local_irq_restore(flags); | ||
173 | return status; | 165 | return status; |
174 | } | 166 | } |
175 | 167 | ||