From 3996bedd210a57aa6b83d83181ea702a6fc5b9b7 Mon Sep 17 00:00:00 2001 From: jdolecek Date: Sun, 22 Apr 2018 07:47:14 +0000 Subject: [PATCH] trigger the softint processing on that child bus which is not detached yet fixes PR kern/53066 by Martin Husemann --- sys/dev/usb/xhci.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/sys/dev/usb/xhci.c b/sys/dev/usb/xhci.c index 052240ce0c61..61995e4c00d4 100644 --- a/sys/dev/usb/xhci.c +++ b/sys/dev/usb/xhci.c @@ -1,4 +1,4 @@ -/* $NetBSD: xhci.c,v 1.88 2018/04/21 15:53:24 jdolecek Exp $ */ +/* $NetBSD: xhci.c,v 1.89 2018/04/22 07:47:14 jdolecek Exp $ */ /* * Copyright (c) 2013 Jonathan A. Kollasch @@ -34,7 +34,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: xhci.c,v 1.88 2018/04/21 15:53:24 jdolecek Exp $"); +__KERNEL_RCSID(0, "$NetBSD: xhci.c,v 1.89 2018/04/22 07:47:14 jdolecek Exp $"); #ifdef _KERNEL_OPT #include "opt_usb.h" @@ -1236,7 +1236,16 @@ xhci_intr(void *v) ret = xhci_intr1(sc); if (ret) { - usb_schedsoftintr(&sc->sc_bus); + KASSERT(sc->sc_child || sc->sc_child2); + + /* + * One of child busses could be already detached. It doesn't + * matter on which of the two the softintr is scheduled. + */ + if (sc->sc_child) + usb_schedsoftintr(&sc->sc_bus); + else + usb_schedsoftintr(&sc->sc_bus2); } done: mutex_spin_exit(&sc->sc_intr_lock);