summaryrefslogtreecommitdiff
path: root/sys/dev/usb/uhub.c
diff options
context:
space:
mode:
authorChristopher Pascoe <pascoe@cvs.openbsd.org>2007-03-22 05:45:58 +0000
committerChristopher Pascoe <pascoe@cvs.openbsd.org>2007-03-22 05:45:58 +0000
commit24e49178717ca01e2548985701c1ba971751050f (patch)
tree78ff1d444f1d7ca12d3b39201712a7f1e6da24a7 /sys/dev/usb/uhub.c
parentb93fdb088d782a58fa4cf8574f67f6e2b426d4d4 (diff)
Reapplication of rev 1.36.
Wait the stable power delay on a USB hub only once per hub (not per port), and defer the delay for root hubs until the host controller event thread starts, permitting some concurrency. Speeds up the boot process dramatically when you have lots of host controllers. ok dlg@
Diffstat (limited to 'sys/dev/usb/uhub.c')
-rw-r--r--sys/dev/usb/uhub.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/dev/usb/uhub.c b/sys/dev/usb/uhub.c
index 631607cdb14..31f0990b9ab 100644
--- a/sys/dev/usb/uhub.c
+++ b/sys/dev/usb/uhub.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uhub.c,v 1.36 2007/03/18 20:14:51 mglocker Exp $ */
+/* $OpenBSD: uhub.c,v 1.37 2007/03/22 05:45:57 pascoe Exp $ */
/* $NetBSD: uhub.c,v 1.64 2003/02/08 03:32:51 ichiro Exp $ */
/* $FreeBSD: src/sys/dev/usb/uhub.c,v 1.18 1999/11/17 22:33:43 n_hibma Exp $ */
@@ -338,10 +338,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. Root hubs delay in their event thread. */
+ if (dev->powersrc->parent != NULL)
+ usbd_delay_ms(dev, pwrdly);
+
/* The usual exploration will finish the setup. */
sc->sc_running = 1;