summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authoraugustss <augustss@NetBSD.org>2003-11-23 19:20:25 +0000
committeraugustss <augustss@NetBSD.org>2003-11-23 19:20:25 +0000
commit0e57233a47d28df29580a9dfaa442d5680fc8dea (patch)
tree3ed82915336466e83260f5c1245d6aff7e87f4ff /sys/dev
parent50ce2db105ed5e2a10fadf29cf86359c3e64d6b8 (diff)
Try harder to avoid 0 ports woth AMD756. From OpenBSD.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/usb/ohci.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/sys/dev/usb/ohci.c b/sys/dev/usb/ohci.c
index 349d7495af0..e6568d746eb 100644
--- a/sys/dev/usb/ohci.c
+++ b/sys/dev/usb/ohci.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ohci.c,v 1.144 2003/11/23 19:18:06 augustss Exp $ */
+/* $NetBSD: ohci.c,v 1.145 2003/11/23 19:20:25 augustss Exp $ */
/* $FreeBSD: src/sys/dev/usb/ohci.c,v 1.22 1999/11/17 22:33:40 n_hibma Exp $ */
/*
@@ -46,7 +46,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ohci.c,v 1.144 2003/11/23 19:18:06 augustss Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ohci.c,v 1.145 2003/11/23 19:20:25 augustss Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -854,8 +854,11 @@ ohci_init(ohci_softc_t *sc)
* The AMD756 requires a delay before re-reading the register,
* otherwise it will occasionally report 0 ports.
*/
- usb_delay_ms(&sc->sc_bus, OHCI_READ_DESC_DELAY);
- sc->sc_noport = OHCI_GET_NDP(OREAD4(sc, OHCI_RH_DESCRIPTOR_A));
+ sc->sc_noport = 0;
+ for (i = 0; i < 10 && sc->sc_noport == 0; i++) {
+ usb_delay_ms(&sc->sc_bus, OHCI_READ_DESC_DELAY);
+ sc->sc_noport = OHCI_GET_NDP(OREAD4(sc, OHCI_RH_DESCRIPTOR_A));
+ }
#ifdef OHCI_DEBUG
if (ohcidebug > 5)