Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/usb uhub(4): Trigger bus exploration after rescannin...



details:   https://anonhg.NetBSD.org/src/rev/7b2ee5f8d300
branches:  trunk
changeset: 1021663:7b2ee5f8d300
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sun Jun 13 00:11:57 2021 +0000

description:
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.

diffstat:

 sys/dev/usb/uhub.c |  8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diffs (29 lines):

diff -r 1cc8b90c5140 -r 7b2ee5f8d300 sys/dev/usb/uhub.c
--- a/sys/dev/usb/uhub.c        Sun Jun 13 00:11:46 2021 +0000
+++ b/sys/dev/usb/uhub.c        Sun Jun 13 00:11:57 2021 +0000
@@ -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 @@
                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;
 }
 



Home | Main Index | Thread Index | Old Index