Do not set the bus dying flag during DVACT_DEACTIVATE otherwise the
authormpi <mpi@openbsd.org>
Thu, 10 Jul 2014 20:57:40 +0000 (20:57 +0000)
committermpi <mpi@openbsd.org>
Thu, 10 Jul 2014 20:57:40 +0000 (20:57 +0000)
explore thread will not disconnect the root hub.  The flag will be
set before detaching the children, like it is done during a suspend-
resume cycle.

Fix a panic when unplugging a cardbus *hci(4).

sys/dev/usb/ehci.c
sys/dev/usb/ohci.c
sys/dev/usb/uhci.c

index 6c4419e..f9ddfd2 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: ehci.c,v 1.159 2014/07/09 15:47:54 mpi Exp $ */
+/*     $OpenBSD: ehci.c,v 1.160 2014/07/10 20:57:40 mpi Exp $ */
 /*     $NetBSD: ehci.c,v 1.66 2004/06/30 03:11:56 mycroft Exp $        */
 
 /*
@@ -1121,10 +1121,6 @@ ehci_activate(struct device *self, int act)
                sc->sc_bus.use_polling--;
                rv = config_activate_children(self, act);
                break;
-       case DVACT_DEACTIVATE:
-               rv = config_activate_children(self, act);
-               sc->sc_bus.dying = 1;
-               break;
        case DVACT_POWERDOWN:
                rv = config_activate_children(self, act);
                ehci_reset(sc);
index 6b99c55..29a9987 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: ohci.c,v 1.134 2014/07/09 15:47:54 mpi Exp $ */
+/*     $OpenBSD: ohci.c,v 1.135 2014/07/10 20:57:40 mpi Exp $ */
 /*     $NetBSD: ohci.c,v 1.139 2003/02/22 05:24:16 tsutsui Exp $       */
 /*     $FreeBSD: src/sys/dev/usb/ohci.c,v 1.22 1999/11/17 22:33:40 n_hibma Exp $       */
 
@@ -353,10 +353,6 @@ ohci_activate(struct device *self, int act)
                sc->sc_bus.use_polling--;
                rv = config_activate_children(self, act);
                break;
-       case DVACT_DEACTIVATE:
-               rv = config_activate_children(self, act);
-               sc->sc_bus.dying = 1;
-               break;
        case DVACT_POWERDOWN:
                rv = config_activate_children(self, act);
                OWRITE4(sc, OHCI_CONTROL, OHCI_HCFS_RESET);
index dcb0d9c..52e7853 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: uhci.c,v 1.125 2014/07/09 15:47:54 mpi Exp $  */
+/*     $OpenBSD: uhci.c,v 1.126 2014/07/10 20:57:40 mpi Exp $  */
 /*     $NetBSD: uhci.c,v 1.172 2003/02/23 04:19:26 simonb Exp $        */
 /*     $FreeBSD: src/sys/dev/usb/uhci.c,v 1.33 1999/11/17 22:33:41 n_hibma Exp $       */
 
@@ -553,10 +553,6 @@ uhci_activate(struct device *self, int act)
 #endif
                rv = config_activate_children(self, act);
                break;
-       case DVACT_DEACTIVATE:
-               rv = config_activate_children(self, act);
-               sc->sc_bus.dying = 1;
-               break;
        default:
                rv = config_activate_children(self, act);
                break;