diff options
author | hselasky <hselasky@FreeBSD.org> | 2013-01-07 16:38:13 +0000 |
---|---|---|
committer | hselasky <hselasky@FreeBSD.org> | 2013-01-07 16:38:13 +0000 |
commit | df2c4939a02300f9c4d66e1a38553e5743cbb5f9 (patch) | |
tree | 6a5314d1312ee8e805f8701118adb8f381c36cf4 | |
parent | 947a420026628a814c3e461f9105d7bfeb6333e3 (diff) | |
download | FreeBSD-src-df2c4939a02300f9c4d66e1a38553e5743cbb5f9.zip FreeBSD-src-df2c4939a02300f9c4d66e1a38553e5743cbb5f9.tar.gz |
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
-rw-r--r-- | sys/dev/usb/controller/xhci.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/dev/usb/controller/xhci.c b/sys/dev/usb/controller/xhci.c index f32e89a..8f721a3 100644 --- a/sys/dev/usb/controller/xhci.c +++ b/sys/dev/usb/controller/xhci.c @@ -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); } |