summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorjmcneill <jmcneill@NetBSD.org>2008-01-25 00:29:12 +0000
committerjmcneill <jmcneill@NetBSD.org>2008-01-25 00:29:12 +0000
commita06bac7d44eed680c5164d60edaf0430df018e8a (patch)
tree8c03c67fb7f2eaa9c685f20e28952f5cb97f8b9d /sys/dev
parent4ecda2ed63f7ad915e7ef90f2934c48aebb05b3e (diff)
Speed up uhub attachment considerably. Rather than powering up each port
individually then waiting for it to become stable, power them up all at once and then delay. Don't even bother delaying if we are a root hub, as this is handled separately in the event thread. From OpenBSD.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/usb/uhub.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/sys/dev/usb/uhub.c b/sys/dev/usb/uhub.c
index 78dcc7a5cdd..78458fa69e4 100644
--- a/sys/dev/usb/uhub.c
+++ b/sys/dev/usb/uhub.c
@@ -1,4 +1,4 @@
-/* $NetBSD: uhub.c,v 1.93 2008/01/04 03:56:47 smb Exp $ */
+/* $NetBSD: uhub.c,v 1.94 2008/01/25 00:29:12 jmcneill Exp $ */
/* $FreeBSD: src/sys/dev/usb/uhub.c,v 1.18 1999/11/17 22:33:43 n_hibma Exp $ */
/*
@@ -43,7 +43,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uhub.c,v 1.93 2008/01/04 03:56:47 smb Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uhub.c,v 1.94 2008/01/25 00:29:12 jmcneill Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -350,10 +350,12 @@ USB_ATTACH(uhub)
USBDEVNAME(sc->sc_dev), port,
usbd_errstr(err));
DPRINTF(("usb_init_port: turn on port %d power\n", port));
- /* Wait for stable power. */
- usbd_delay_ms(dev, pwrdly);
}
+ /* Wait for stable power if we are not a root hub */
+ if (dev->powersrc->parent != NULL)
+ usbd_delay_ms(dev, pwrdly);
+
/* The usual exploration will finish the setup. */
sc->sc_running = 1;