From 7672c07e619cda5472c7e6130dedc702a44c1a6d Mon Sep 17 00:00:00 2001 From: claudio Date: Thu, 20 Jul 2023 09:43:00 +0000 Subject: [PATCH] Revert rev 1.129: When detaching devices when we suspend, we need to continue processing command completion events. So only return early in xhci_softintr() if the controller is dead instead of dying. This fixes USB suspend/resume in Apple M1/M2. ok mlarkin@, deraadt@ ----- The change does not only allow completion events to be processed but also events that get processed by the drivers attached to this usb bus. As a result I see a uvm panic on suspend in urtwn(4) which is triggered by a bad rx eof. OK kettenis@ --- sys/dev/usb/xhci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/usb/xhci.c b/sys/dev/usb/xhci.c index 8b78d5ff2cb..324bc0162c0 100644 --- a/sys/dev/usb/xhci.c +++ b/sys/dev/usb/xhci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: xhci.c,v 1.129 2023/07/16 09:33:18 kettenis Exp $ */ +/* $OpenBSD: xhci.c,v 1.130 2023/07/20 09:43:00 claudio Exp $ */ /* * Copyright (c) 2014-2015 Martin Pieuchot @@ -656,7 +656,7 @@ xhci_softintr(void *v) { struct xhci_softc *sc = v; - if (sc->sc_dead) + if (sc->sc_bus.dying) return; sc->sc_bus.intr_context++; -- 2.20.1