Module Name:    src
Committed By:   riastradh
Date:           Sun Jun 13 00:11:57 UTC 2021

Modified Files:
        src/sys/dev/usb: uhub.c

Log Message:
uhub(4): Trigger bus exploration after rescanning children.

Otherwise, if uhub4 is attached at uhub1, then when we do

        # drvctl -d uhub4
        # drvctl -r -a usbdevif uhub1

the rescan never discovers devices attached recursively at uhub4, and
uhub4 leaks a config_pending_incr count so it can't be detached.


To generate a diff of this commit:
cvs rdiff -u -r1.150 -r1.151 src/sys/dev/usb/uhub.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/usb/uhub.c
diff -u src/sys/dev/usb/uhub.c:1.150 src/sys/dev/usb/uhub.c:1.151
--- src/sys/dev/usb/uhub.c:1.150	Sat Jun 12 12:13:23 2021
+++ src/sys/dev/usb/uhub.c	Sun Jun 13 00:11:57 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: uhub.c,v 1.150 2021/06/12 12:13:23 riastradh Exp $	*/
+/*	$NetBSD: uhub.c,v 1.151 2021/06/13 00:11:57 riastradh Exp $	*/
 /*	$FreeBSD: src/sys/dev/usb/uhub.c,v 1.18 1999/11/17 22:33:43 n_hibma Exp $	*/
 /*	$OpenBSD: uhub.c,v 1.86 2015/06/29 18:27:40 mpi Exp $ */
 
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uhub.c,v 1.150 2021/06/12 12:13:23 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uhub.c,v 1.151 2021/06/13 00:11:57 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -946,6 +946,10 @@ uhub_rescan(device_t self, const char *i
 		usbd_reattach_device(sc->sc_dev, dev, port, locators);
 	}
 	uhub_explore_exit(sc);
+
+	/* Arrange to recursively explore hubs we may have found.  */
+	usb_needs_explore(sc->sc_hub);
+
 	return 0;
 }
 

Reply via email to