Optimise the XHCI interrupt handling.

This patch will save CPU time when the XHCI interrupt is
shared with other devices.
Only check event rings when interrupt bits are set.
Otherwise would indicate hiding possible hardware fault(s).

Tested by:	sos @
Submitted by:	sos @
MFC after:	1 week
This commit is contained in:
Hans Petter Selasky 2013-01-07 16:38:13 +00:00
parent 98f5c0d41a
commit 878b1fbdce
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=245132

View File

@ -1459,7 +1459,9 @@ xhci_interrupt(struct xhci_softc *sc)
DPRINTFN(16, "real interrupt (sts=0x%08x, "
"iman=0x%08x)\n", status, temp);
if (status != 0) {
if (status & (XHCI_STS_PCD | XHCI_STS_HCH |
XHCI_STS_HSE | XHCI_STS_HCE)) {
if (status & XHCI_STS_PCD) {
xhci_root_intr(sc);
}
@ -1480,7 +1482,9 @@ xhci_interrupt(struct xhci_softc *sc)
}
}
xhci_interrupt_poll(sc);
/* check if we need to check the event rings */
if ((status != 0) || (temp & XHCI_IMAN_INTR_PEND))
xhci_interrupt_poll(sc);
USB_BUS_UNLOCK(&sc->sc_bus);
}