diff options
author | marius <marius@FreeBSD.org> | 2013-03-02 13:08:13 +0000 |
---|---|---|
committer | marius <marius@FreeBSD.org> | 2013-03-02 13:08:13 +0000 |
commit | ee248b021f7bf872e6ec7ad05e281873bfe22f7d (patch) | |
tree | abe23931d9f38ebfd9c6abddf5684389c5133be0 /sys/sparc64/sbus | |
parent | b1d7b9754bbc645b03e7920d1a2b39ff3848afdc (diff) | |
download | FreeBSD-src-ee248b021f7bf872e6ec7ad05e281873bfe22f7d.zip FreeBSD-src-ee248b021f7bf872e6ec7ad05e281873bfe22f7d.tar.gz |
- Revert the part of r247601 which turned the overtemperature and power fail
interrupt shutdown handlers into filters. Shutdown_nice(9) acquires a sleep
lock, which filters shouldn't do. It also seems that kern_reboot(9) still
may require Giant to be hold.
- Correct an incorrect argument to shutdown_nice(9).
Submitted by: bde
Diffstat (limited to 'sys/sparc64/sbus')
-rw-r--r-- | sys/sparc64/sbus/sbus.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/sys/sparc64/sbus/sbus.c b/sys/sparc64/sbus/sbus.c index 6c69e2d..580624f 100644 --- a/sys/sparc64/sbus/sbus.c +++ b/sys/sparc64/sbus/sbus.c @@ -152,8 +152,8 @@ static void sbus_intr_assign(void *); static void sbus_intr_clear(void *); static int sbus_find_intrmap(struct sbus_softc *, u_int, bus_addr_t *, bus_addr_t *); -static driver_filter_t sbus_overtemp; -static driver_filter_t sbus_pwrfail; +static driver_intr_t sbus_overtemp; +static driver_intr_t sbus_pwrfail; static int sbus_print_res(struct sbus_devinfo *); static device_method_t sbus_methods[] = { @@ -410,7 +410,7 @@ sbus_attach(device_t dev) INTVEC(SYSIO_READ8(sc, SBR_THERM_INT_MAP)) != vec || intr_vectors[vec].iv_ic != &sbus_ic || bus_setup_intr(dev, sc->sc_ot_ires, INTR_TYPE_MISC | INTR_BRIDGE, - sbus_overtemp, NULL, sc, &sc->sc_ot_ihand) != 0) + NULL, sbus_overtemp, sc, &sc->sc_ot_ihand) != 0) panic("%s: failed to set up temperature interrupt", __func__); i = 3; sc->sc_pf_ires = bus_alloc_resource_any(dev, SYS_RES_IRQ, &i, @@ -420,7 +420,7 @@ sbus_attach(device_t dev) INTVEC(SYSIO_READ8(sc, SBR_POWER_INT_MAP)) != vec || intr_vectors[vec].iv_ic != &sbus_ic || bus_setup_intr(dev, sc->sc_pf_ires, INTR_TYPE_MISC | INTR_BRIDGE, - sbus_pwrfail, NULL, sc, &sc->sc_pf_ihand) != 0) + NULL, sbus_pwrfail, sc, &sc->sc_pf_ihand) != 0) panic("%s: failed to set up power fail interrupt", __func__); /* Initialize the counter-timer. */ @@ -897,33 +897,31 @@ sbus_get_devinfo(device_t bus, device_t child) * This handles the interrupt and powers off the machine. * The same needs to be done to PCI controller drivers. */ -static int +static void sbus_overtemp(void *arg __unused) { static int shutdown; /* As the interrupt is cleared we may be called multiple times. */ if (shutdown != 0) - return (FILTER_HANDLED); + return; shutdown++; printf("DANGER: OVER TEMPERATURE detected\nShutting down NOW.\n"); shutdown_nice(RB_POWEROFF); - return (FILTER_HANDLED); } /* Try to shut down in time in case of power failure. */ -static int +static void sbus_pwrfail(void *arg __unused) { static int shutdown; /* As the interrupt is cleared we may be called multiple times. */ if (shutdown != 0) - return (FILTER_HANDLED); + return; shutdown++; printf("Power failure detected\nShutting down NOW.\n"); - shutdown_nice(FILTER_HANDLED); - return (FILTER_HANDLED); + shutdown_nice(RB_POWEROFF); } static int |