svn commit: r323147 - head/sys/arm/arm
Andrew Turner
andrew at FreeBSD.org
Sun Sep 3 09:41:41 UTC 2017
Author: andrew
Date: Sun Sep 3 09:41:40 2017
New Revision: 323147
URL: https://svnweb.freebsd.org/changeset/base/323147
Log:
Disable the ARM generic timers before interrupts are enabled. Some
Raspberry Pi firmware images leave them enabled causing an interrupt storm.
Sponsored by: ABT Systems Ltd
Modified:
head/sys/arm/arm/generic_timer.c
Modified: head/sys/arm/arm/generic_timer.c
==============================================================================
--- head/sys/arm/arm/generic_timer.c Sun Sep 3 09:18:39 2017 (r323146)
+++ head/sys/arm/arm/generic_timer.c Sun Sep 3 09:41:40 2017 (r323147)
@@ -249,18 +249,24 @@ arm_tmr_start(struct eventtimer *et, sbintime_t first,
}
+static void
+arm_tmr_disable(bool physical)
+{
+ int ctrl;
+
+ ctrl = get_ctrl(physical);
+ ctrl &= ~GT_CTRL_ENABLE;
+ set_ctrl(ctrl, physical);
+}
+
static int
arm_tmr_stop(struct eventtimer *et)
{
struct arm_tmr_softc *sc;
- int ctrl;
sc = (struct arm_tmr_softc *)et->et_priv;
+ arm_tmr_disable(sc->physical);
- ctrl = get_ctrl(sc->physical);
- ctrl &= ~GT_CTRL_ENABLE;
- set_ctrl(ctrl, sc->physical);
-
return (0);
}
@@ -411,6 +417,13 @@ arm_tmr_attach(device_t dev)
return (ENXIO);
}
}
+
+ /* Disable the virtual timer until we are ready */
+ if (sc->res[2] != NULL)
+ arm_tmr_disable(false);
+ /* And the physical */
+ if (sc->physical)
+ arm_tmr_disable(true);
arm_tmr_timecount.tc_frequency = sc->clkfreq;
tc_init(&arm_tmr_timecount);
More information about the svn-src-head
mailing list