summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb/uhub.c
diff options
context:
space:
mode:
authorpascoe <pascoe@openbsd.org>2007-03-22 05:45:57 +0000
committerpascoe <pascoe@openbsd.org>2007-03-22 05:45:57 +0000
commit710507074f079e1f27bf611a3ff75ae9a5a6a163 (patch)
tree0cc7c76dc2da8b2f80d94901da752efaff68ca19 /sys/dev/usb/uhub.c
parentLet atascsi issue NCQ commands if the controller supports it. (diff)
downloadwireguard-openbsd-710507074f079e1f27bf611a3ff75ae9a5a6a163.tar.xz
wireguard-openbsd-710507074f079e1f27bf611a3ff75ae9a5a6a163.zip
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;