mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-29 18:11:20 +00:00
clocksource/drivers/timer-atmel-pit: Simplify IRQ handler
Because the PIT is also a proper clocksource, the timekeeping code is already able to handle lost ticks. Reported-by: Thomas Gleixner <tglx@linutronix.de> Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
This commit is contained in:
parent
0d41ec8dbf
commit
2783e5d63a
1 changed files with 3 additions and 8 deletions
|
@ -152,15 +152,10 @@ static irqreturn_t at91sam926x_pit_interrupt(int irq, void *dev_id)
|
||||||
/* The PIT interrupt may be disabled, and is shared */
|
/* The PIT interrupt may be disabled, and is shared */
|
||||||
if (clockevent_state_periodic(&data->clkevt) &&
|
if (clockevent_state_periodic(&data->clkevt) &&
|
||||||
(pit_read(data->base, AT91_PIT_SR) & AT91_PIT_PITS)) {
|
(pit_read(data->base, AT91_PIT_SR) & AT91_PIT_PITS)) {
|
||||||
unsigned nr_ticks;
|
|
||||||
|
|
||||||
/* Get number of ticks performed before irq, and ack it */
|
/* Get number of ticks performed before irq, and ack it */
|
||||||
nr_ticks = PIT_PICNT(pit_read(data->base, AT91_PIT_PIVR));
|
data->cnt += data->cycle * PIT_PICNT(pit_read(data->base,
|
||||||
do {
|
AT91_PIT_PIVR));
|
||||||
data->cnt += data->cycle;
|
data->clkevt.event_handler(&data->clkevt);
|
||||||
data->clkevt.event_handler(&data->clkevt);
|
|
||||||
nr_ticks--;
|
|
||||||
} while (nr_ticks);
|
|
||||||
|
|
||||||
return IRQ_HANDLED;
|
return IRQ_HANDLED;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue