diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2022-07-15 07:52:07 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2022-07-15 07:52:07 +0000 |
commit | 7d41fff29c4434847e7d31a03dede8df102f80bd (patch) | |
tree | 88e548026c5024f5dcfba604548a8ebee3c29850 /sys | |
parent | 4f3474445e2503290a72f47b2d9588d9446ead89 (diff) |
Use a separate varaible to signal a "dead" controller (that has disappeared
from the bus, probably because of hot(un)plugging it). This makes sure
that we still ack interrupts that arrive while the controller is "dying"
(when we go down into suspend or if an unrecoverable hardware error
occurs). Fixes an interrupt storm when we suspend on Amlogic arm64 boards.
ok deraadt@
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/usb/xhci.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/dev/usb/xhci.c b/sys/dev/usb/xhci.c index 8f894cc0308..4bec4e0169c 100644 --- a/sys/dev/usb/xhci.c +++ b/sys/dev/usb/xhci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: xhci.c,v 1.125 2022/04/12 19:41:11 naddy Exp $ */ +/* $OpenBSD: xhci.c,v 1.126 2022/07/15 07:52:06 kettenis Exp $ */ /* * Copyright (c) 2014-2015 Martin Pieuchot @@ -593,7 +593,7 @@ xhci_intr(void *v) { struct xhci_softc *sc = v; - if (sc == NULL || sc->sc_bus.dying) + if (sc->sc_dead) return (0); /* If we get an interrupt while polling, then just ignore it. */ @@ -613,6 +613,7 @@ xhci_intr1(struct xhci_softc *sc) intrs = XOREAD4(sc, XHCI_USBSTS); if (intrs == 0xffffffff) { sc->sc_bus.dying = 1; + sc->sc_dead = 1; return (0); } |