From: kettenis Date: Fri, 15 Jul 2022 07:52:06 +0000 (+0000) Subject: Use a separate varaible to signal a "dead" controller (that has disappeared X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=94e125fc9a5822617f08b07aca3c1369f96aeed3;p=openbsd 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@ --- 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); }