diff options
author | Christopher Pascoe <pascoe@cvs.openbsd.org> | 2007-03-22 05:45:58 +0000 |
---|---|---|
committer | Christopher Pascoe <pascoe@cvs.openbsd.org> | 2007-03-22 05:45:58 +0000 |
commit | 24e49178717ca01e2548985701c1ba971751050f (patch) | |
tree | 78ff1d444f1d7ca12d3b39201712a7f1e6da24a7 /sys/dev/usb/usb.c | |
parent | b93fdb088d782a58fa4cf8574f67f6e2b426d4d4 (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/usb.c')
-rw-r--r-- | sys/dev/usb/usb.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/sys/dev/usb/usb.c b/sys/dev/usb/usb.c index b8012f31e27..3c18886ff01 100644 --- a/sys/dev/usb/usb.c +++ b/sys/dev/usb/usb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: usb.c,v 1.37 2007/03/18 20:14:51 mglocker Exp $ */ +/* $OpenBSD: usb.c,v 1.38 2007/03/22 05:45:57 pascoe Exp $ */ /* $NetBSD: usb.c,v 1.77 2003/01/01 00:10:26 thorpej Exp $ */ /* @@ -304,9 +304,15 @@ void usb_event_thread(void *arg) { struct usb_softc *sc = arg; + int pwrdly; DPRINTF(("usb_event_thread: start\n")); + /* Wait for power to come good. */ + pwrdly = sc->sc_bus->root_hub->hub->hubdesc.bPwrOn2PwrGood * + UHD_PWRON_FACTOR + USB_EXTRA_POWER_UP_TIME; + usb_delay_ms(sc->sc_bus, pwrdly); + /* USB1 threads wait for USB2 threads to finish their first probe. */ while (sc->sc_bus->usbrev != USBREV_2_0 && threads_pending) (void)tsleep((void *)&threads_pending, PWAIT, "config", 0); |