summaryrefslogtreecommitdiff
path: root/sys/dev/pci/uhci_pci.c
diff options
context:
space:
mode:
authorMichael Shalayeff <mickey@cvs.openbsd.org>2001-06-12 19:12:00 +0000
committerMichael Shalayeff <mickey@cvs.openbsd.org>2001-06-12 19:12:00 +0000
commit63c10588b0feccdbeac9a9dd93201b641a8551b6 (patch)
tree5d66680ccb8825b5ccfa79be79916d0fc7e5e7ac /sys/dev/pci/uhci_pci.c
parent2f544822d4185aa75fe1a8c8543107769047779a (diff)
interrupts cannot happen before
*hci cannot receive interrupts before it has been initialized. this was changed to accomodate the pcibios strategy change back in pre-2.9 times since *hci_init enables interrupts at it's end and thus unmapped pci interrupt hangs the machine in the endless loop trying to deliver it (and no hci handler to ack it). this new way we disable interrupts by hands before we map 'em on pci and thus ensure that they will not crash an uninitialized *hci which, in turn, will run right after the interrupt map/establish and by the time it enables *hci interrupts all gonna be just fine. please allow us to end this stretched remark for cvs is getting a power outage in less than 20 minutes.
Diffstat (limited to 'sys/dev/pci/uhci_pci.c')
-rw-r--r--sys/dev/pci/uhci_pci.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/sys/dev/pci/uhci_pci.c b/sys/dev/pci/uhci_pci.c
index b871a7237a3..71444830743 100644
--- a/sys/dev/pci/uhci_pci.c
+++ b/sys/dev/pci/uhci_pci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uhci_pci.c,v 1.10 2001/06/12 15:40:33 niklas Exp $ */
+/* $OpenBSD: uhci_pci.c,v 1.11 2001/06/12 19:11:59 mickey Exp $ */
/* $NetBSD: uhci_pci.c,v 1.14 2000/01/25 11:26:06 augustss Exp $ */
/*
@@ -142,11 +142,11 @@ uhci_pci_attach(parent, self, aux)
break;
}
- r = uhci_init(&sc->sc);
- if (r != USBD_NORMAL_COMPLETION) {
- printf(": init failed, error=%d\n", r);
- return;
- }
+ uhci_run(&sc->sc, 0); /* stop the controller */
+ /* disable interrupts */
+ bus_space_barrier(sc->sc.iot, sc->sc.ioh, 0, sc->sc.sc_size,
+ BUS_SPACE_BARRIER_READ|BUS_SPACE_BARRIER_WRITE);
+ bus_space_write_2(sc->sc.iot, sc->sc.ioh, UHCI_INTR, 0);
/* Map and establish the interrupt. */
if (pci_intr_map(pc, pa->pa_intrtag, pa->pa_intrpin,
@@ -166,6 +166,12 @@ uhci_pci_attach(parent, self, aux)
}
printf(": %s\n", intrstr);
+ r = uhci_init(&sc->sc);
+ if (r != USBD_NORMAL_COMPLETION) {
+ printf(": init failed, error=%d\n", r);
+ return;
+ }
+
/* Attach usb device. */
sc->sc.sc_child = config_found((void *)sc, &sc->sc.sc_bus,
usbctlprint);