summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Pascoe <pascoe@cvs.openbsd.org>2005-04-21 12:30:03 +0000
committerChristopher Pascoe <pascoe@cvs.openbsd.org>2005-04-21 12:30:03 +0000
commitc22d66b26f3773cfad5b2d27ee616cd0a0f5acb0 (patch)
tree68a275a5c02f3ae2be79b8c25310c31e4dc43bcf
parent669cbf66fe301ad1daf2bd426cd98e85331933a6 (diff)
If the SMM driver had enabled ownership change interrupts, re-enable them
temporarily before we attempt to take control. ok dlg@
-rw-r--r--sys/dev/pci/ohci_pci.c6
-rw-r--r--sys/dev/usb/ohci.c6
2 files changed, 10 insertions, 2 deletions
diff --git a/sys/dev/pci/ohci_pci.c b/sys/dev/pci/ohci_pci.c
index ca7ddc4a1e6..3f3e36ffa20 100644
--- a/sys/dev/pci/ohci_pci.c
+++ b/sys/dev/pci/ohci_pci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ohci_pci.c,v 1.24 2005/04/11 08:09:32 dlg Exp $ */
+/* $OpenBSD: ohci_pci.c,v 1.25 2005/04/21 12:30:02 pascoe Exp $ */
/* $NetBSD: ohci_pci.c,v 1.23 2002/10/02 16:51:47 thorpej Exp $ */
/*
@@ -120,6 +120,10 @@ ohci_pci_attach(struct device *parent, struct device *self, void *aux)
return;
}
+ /* Record what interrupts were enabled by SMM/BIOS. */
+ sc->sc.sc_intre = bus_space_read_4(sc->sc.iot, sc->sc.ioh,
+ OHCI_INTERRUPT_ENABLE);
+
/* Disable interrupts, so we don't get any spurious ones. */
bus_space_write_4(sc->sc.iot, sc->sc.ioh, OHCI_INTERRUPT_DISABLE,
OHCI_MIE);
diff --git a/sys/dev/usb/ohci.c b/sys/dev/usb/ohci.c
index b5bacd0cb82..fc46861693b 100644
--- a/sys/dev/usb/ohci.c
+++ b/sys/dev/usb/ohci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ohci.c,v 1.60 2005/04/21 10:00:30 pascoe Exp $ */
+/* $OpenBSD: ohci.c,v 1.61 2005/04/21 12:30:02 pascoe Exp $ */
/* $NetBSD: ohci.c,v 1.139 2003/02/22 05:24:16 tsutsui Exp $ */
/* $FreeBSD: src/sys/dev/usb/ohci.c,v 1.22 1999/11/17 22:33:40 n_hibma Exp $ */
@@ -758,12 +758,16 @@ ohci_init(ohci_softc_t *sc)
if (ctl & OHCI_IR) {
/* SMM active, request change */
DPRINTF(("ohci_init: SMM active, request owner change\n"));
+ if ((sc->sc_intre & (OHCI_OC | OHCI_MIE)) ==
+ (OHCI_OC | OHCI_MIE))
+ OWRITE4(sc, OHCI_INTERRUPT_ENABLE, OHCI_MIE);
s = OREAD4(sc, OHCI_COMMAND_STATUS);
OWRITE4(sc, OHCI_COMMAND_STATUS, s | OHCI_OCR);
for (i = 0; i < 100 && (ctl & OHCI_IR); i++) {
usb_delay_ms(&sc->sc_bus, 1);
ctl = OREAD4(sc, OHCI_CONTROL);
}
+ OWRITE4(sc, OHCI_INTERRUPT_DISABLE, OHCI_MIE);
if (ctl & OHCI_IR) {
printf("%s: SMM does not respond, resetting\n",
USBDEVNAME(sc->sc_bus.bdev));