From 13156a52410b07f3c76ca5d5245f69799222b58a Mon Sep 17 00:00:00 2001 From: Hans Petter Selasky Date: Sat, 11 Jan 2014 08:10:01 +0000 Subject: [PATCH] Force clearing of event ring interrupts. The "Intel Lynx Point" XHCI controller found in the MBP2013 has been observed to not work properly unless this operation is performed. MFC after: 1 week Tested by: Huang Wen Hui --- sys/dev/usb/controller/xhci.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sys/dev/usb/controller/xhci.c b/sys/dev/usb/controller/xhci.c index dcf074ed547f..024b18ed6c93 100644 --- a/sys/dev/usb/controller/xhci.c +++ b/sys/dev/usb/controller/xhci.c @@ -1578,6 +1578,7 @@ void xhci_interrupt(struct xhci_softc *sc) { uint32_t status; + uint32_t temp; USB_BUS_LOCK(&sc->sc_bus); @@ -1588,6 +1589,12 @@ xhci_interrupt(struct xhci_softc *sc) XWRITE4(sc, oper, XHCI_USBSTS, status); DPRINTFN(16, "real interrupt (status=0x%08x)\n", status); + + temp = XREAD4(sc, runt, XHCI_IMAN(0)); + + /* force clearing of pending interrupts */ + if (temp & XHCI_IMAN_INTR_PEND) + XWRITE4(sc, runt, XHCI_IMAN(0), temp); /* check for event(s) */ xhci_interrupt_poll(sc);