summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorriastradh <riastradh@NetBSD.org>2022-09-13 10:33:37 +0000
committerriastradh <riastradh@NetBSD.org>2022-09-13 10:33:37 +0000
commit0773a4caaba58dc4a9fb30dea70427c384a42320 (patch)
treea3896846f7ca098d33543a745f2a128bcf096119 /sys/dev
parent339e16bea902e2fc07bfb77563198ddc61045398 (diff)
xhci(4): After attach, access to sc_child/2 requires sc_intr_lock.
Serializes access with xhci_intr. XXX Need to ensure the interrupt handler is quiesced at this point or else it will trip over the assertion in xhci_intr about having at least one child.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/usb/xhci.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/dev/usb/xhci.c b/sys/dev/usb/xhci.c
index 56c940a34e2..49f328ce249 100644
--- a/sys/dev/usb/xhci.c
+++ b/sys/dev/usb/xhci.c
@@ -1,4 +1,4 @@
-/* $NetBSD: xhci.c,v 1.170 2022/09/13 10:15:28 riastradh Exp $ */
+/* $NetBSD: xhci.c,v 1.171 2022/09/13 10:33:37 riastradh Exp $ */
/*
* Copyright (c) 2013 Jonathan A. Kollasch
@@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: xhci.c,v 1.170 2022/09/13 10:15:28 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xhci.c,v 1.171 2022/09/13 10:33:37 riastradh Exp $");
#ifdef _KERNEL_OPT
#include "opt_usb.h"
@@ -605,11 +605,13 @@ xhci_childdet(device_t self, device_t child)
{
struct xhci_softc * const sc = device_private(self);
+ mutex_enter(&sc->sc_intr_lock);
KASSERT((sc->sc_child == child) || (sc->sc_child2 == child));
if (child == sc->sc_child2)
sc->sc_child2 = NULL;
else if (child == sc->sc_child)
sc->sc_child = NULL;
+ mutex_exit(&sc->sc_intr_lock);
}
int