aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Thompson <thompsa@FreeBSD.org>2009-01-26 17:55:07 +0000
committerAndrew Thompson <thompsa@FreeBSD.org>2009-01-26 17:55:07 +0000
commit023ac6ce6796e70ea735571eeab22b032bfd5a84 (patch)
treeaf8700479554ccdd650e79672e73e2aae2f0201b
parent6bd202b0cea5b139824183f5fe2590aa696cfe48 (diff)
downloadsrc-023ac6ce6796e70ea735571eeab22b032bfd5a84.tar.gz
src-023ac6ce6796e70ea735571eeab22b032bfd5a84.zip
MFp4 //depot/projects/usb/ @156706
Adjust an UHCI portreset delay. Submitted by: Hans Petter Selasky
Notes
Notes: svn path=/head/; revision=187732
-rw-r--r--sys/dev/usb2/controller/uhci2.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/sys/dev/usb2/controller/uhci2.c b/sys/dev/usb2/controller/uhci2.c
index e967a9e9a0c0..ef9bce2f86b5 100644
--- a/sys/dev/usb2/controller/uhci2.c
+++ b/sys/dev/usb2/controller/uhci2.c
@@ -2431,12 +2431,16 @@ uhci_portreset(uhci_softc_t *sc, uint16_t index, uint8_t use_polling)
x = URWMASK(UREAD2(sc, port));
UWRITE2(sc, port, x & ~UHCI_PORTSC_PR);
- if (use_polling) {
- /* polling */
- DELAY(1000);
- } else {
- usb2_pause_mtx(&sc->sc_bus.bus_mtx, 1);
- }
+
+ mtx_unlock(&sc->sc_bus.bus_mtx);
+
+ /*
+ * This delay needs to be exactly 100us, else some USB devices
+ * fail to attach!
+ */
+ DELAY(100);
+
+ mtx_lock(&sc->sc_bus.bus_mtx);
DPRINTFN(4, "uhci port %d reset, status1 = 0x%04x\n",
index, UREAD2(sc, port));