Clear timer interrupt status before calling callback, not after it,
This fixes timer interrupt losses, fatal in one-shot mode.
This commit is contained in:
parent
b9d3291981
commit
7066648caf
@ -178,14 +178,14 @@ mv_hardclock(void *arg)
|
||||
struct mv_timer_softc *sc;
|
||||
uint32_t irq_cause;
|
||||
|
||||
sc = (struct mv_timer_softc *)arg;
|
||||
if (sc->et.et_active)
|
||||
sc->et.et_event_cb(&sc->et, sc->et.et_arg);
|
||||
|
||||
irq_cause = read_cpu_ctrl(BRIDGE_IRQ_CAUSE);
|
||||
irq_cause &= ~(IRQ_TIMER0);
|
||||
write_cpu_ctrl(BRIDGE_IRQ_CAUSE, irq_cause);
|
||||
|
||||
sc = (struct mv_timer_softc *)arg;
|
||||
if (sc->et.et_active)
|
||||
sc->et.et_event_cb(&sc->et, sc->et.et_arg);
|
||||
|
||||
return (FILTER_HANDLED);
|
||||
}
|
||||
|
||||
@ -394,6 +394,8 @@ mv_timer_start(struct eventtimer *et,
|
||||
val |= CPU_TIMER0_EN;
|
||||
if (period != NULL)
|
||||
val |= CPU_TIMER0_AUTO;
|
||||
else
|
||||
val &= ~CPU_TIMER0_AUTO;
|
||||
mv_set_timer_control(val);
|
||||
return (0);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user