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: Skip USB_POWER_DOWN_TIME delay for root hubs



details:   https://anonhg.NetBSD.org/src/rev/a24186824e96
branches:  trunk
changeset: 989056:a24186824e96
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Mon Oct 11 00:16:08 2021 +0000

description:
uhub: Skip USB_POWER_DOWN_TIME delay for root hubs

diffstat:

 sys/dev/usb/uhub.c |  9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diffs (30 lines):

diff -r ad0130794e18 -r a24186824e96 sys/dev/usb/uhub.c
--- a/sys/dev/usb/uhub.c        Mon Oct 11 00:08:31 2021 +0000
+++ b/sys/dev/usb/uhub.c        Mon Oct 11 00:16:08 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uhub.c,v 1.155 2021/10/11 00:08:31 jmcneill Exp $      */
+/*     $NetBSD: uhub.c,v 1.156 2021/10/11 00:16:08 jmcneill 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.155 2021/10/11 00:08:31 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uhub.c,v 1.156 2021/10/11 00:16:08 jmcneill Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -388,8 +388,9 @@
                goto bad;
        }
 
-       /* Wait with power off for a while. */
-       usbd_delay_ms(dev, USB_POWER_DOWN_TIME);
+       /* Wait with power off for a while if we are not a root hub */
+       if (dev->ud_powersrc->up_parent != NULL)
+               usbd_delay_ms(dev, USB_POWER_DOWN_TIME);
 
        usbd_add_drv_event(USB_EVENT_DRIVER_ATTACH, dev, sc->sc_dev);
 



Home | Main Index | Thread Index | Old Index