summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormav <mav@FreeBSD.org>2010-09-18 13:44:39 +0000
committermav <mav@FreeBSD.org>2010-09-18 13:44:39 +0000
commit7066648caf203091037ddc9dc452bcb0ef9aad45 (patch)
treeb7991e66397dddbcd54a258f7daacf5fcf599574
parentb9d3291981a5e5a3fccba50333b2a4cdbe6486ac (diff)
downloadFreeBSD-src-7066648caf203091037ddc9dc452bcb0ef9aad45.zip
FreeBSD-src-7066648caf203091037ddc9dc452bcb0ef9aad45.tar.gz
Clear timer interrupt status before calling callback, not after it,
This fixes timer interrupt losses, fatal in one-shot mode.
-rw-r--r--sys/arm/mv/timer.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/sys/arm/mv/timer.c b/sys/arm/mv/timer.c
index bcc4e81..fb3b321 100644
--- a/sys/arm/mv/timer.c
+++ b/sys/arm/mv/timer.c
@@ -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);
}
OpenPOWER on IntegriCloud