Commit 39806805 authored by Andrew Victor's avatar Andrew Victor Committed by Russell King

[ARM] 3384/1: AT91RM9200: Timer

Patch from Andrew Victor

If the timer interrupt is ever significantly delayed (or after the
system was suspended), the system could spin incrementing the time for
too long.
The fix is to replace the "do {} while" with a "while {}".

Orignal patch by Savin Zlobec and Peter Menzebach.
Signed-off-by: default avatarAndrew Victor <andrew@sanpeople.com>
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent 112d02e8
...@@ -71,11 +71,11 @@ static irqreturn_t at91rm9200_timer_interrupt(int irq, void *dev_id, struct pt_r ...@@ -71,11 +71,11 @@ static irqreturn_t at91rm9200_timer_interrupt(int irq, void *dev_id, struct pt_r
if (at91_sys_read(AT91_ST_SR) & AT91_ST_PITS) { /* This is a shared interrupt */ if (at91_sys_read(AT91_ST_SR) & AT91_ST_PITS) { /* This is a shared interrupt */
write_seqlock(&xtime_lock); write_seqlock(&xtime_lock);
do { while (((read_CRTR() - at91_sys_read(AT91_ST_RTAR)) & AT91_ST_ALMV) >= LATCH) {
timer_tick(regs); timer_tick(regs);
rtar = (at91_sys_read(AT91_ST_RTAR) + LATCH) & AT91_ST_ALMV; rtar = (at91_sys_read(AT91_ST_RTAR) + LATCH) & AT91_ST_ALMV;
at91_sys_write(AT91_ST_RTAR, rtar); at91_sys_write(AT91_ST_RTAR, rtar);
} while (((read_CRTR() - at91_sys_read(AT91_ST_RTAR)) & AT91_ST_ALMV) >= LATCH); }
write_sequnlock(&xtime_lock); write_sequnlock(&xtime_lock);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment