diff options
author | 2004-08-11 04:15:10 +0000 | |
---|---|---|
committer | 2004-08-11 04:15:10 +0000 | |
commit | 8bcfbfcb0d9a859d3a3cb59f0c89dad1aa09d429 (patch) | |
tree | 7cc9d0eb54bf309fd7c06fe782a3885a212586e2 | |
parent | from netbsd, ohci.c 1.140, 1.143, 1.148, 1.149, 1.150 (diff) | |
download | wireguard-openbsd-8bcfbfcb0d9a859d3a3cb59f0c89dad1aa09d429.tar.xz wireguard-openbsd-8bcfbfcb0d9a859d3a3cb59f0c89dad1aa09d429.zip |
from netbsd-bugs, pr 26545:
It's possible that the ohci interrupt can reach the CPU before the write
over PCI. This results in the done head pointer being NULL. If the
subsequent read of the interrupt status indicates that an OHCI_WDH has
occured then the done pointer should be reread and the pointer nulled.
-rw-r--r-- | sys/dev/usb/ohci.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/sys/dev/usb/ohci.c b/sys/dev/usb/ohci.c index 36320e40f0b..a6a81b0aacb 100644 --- a/sys/dev/usb/ohci.c +++ b/sys/dev/usb/ohci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ohci.c,v 1.46 2004/08/11 04:12:43 dlg Exp $ */ +/* $OpenBSD: ohci.c,v 1.47 2004/08/11 04:15:10 dlg 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 $ */ @@ -1126,8 +1126,14 @@ ohci_intr1(ohci_softc_t *sc) if (done & OHCI_DONE_INTRS) intrs |= OREAD4(sc, OHCI_INTERRUPT_STATUS); sc->sc_hcca->hcca_done_head = 0; - } else - intrs = OREAD4(sc, OHCI_INTERRUPT_STATUS) & ~OHCI_WDH; + } else { + intrs = OREAD4(sc, OHCI_INTERRUPT_STATUS); + /* If we've flushed out a WDH then reread */ + if (intrs & OHCI_WDH) { + done = le32toh(sc->sc_hcca->hcca_done_head); + sc->sc_hcca->hcca_done_head = 0; + } + } if (!intrs) return (0); |