svn commit: r261096 - stable/10/sys/dev/usb/controller

Hans Petter Selasky hselasky at FreeBSD.org
Fri Jan 24 07:24:41 UTC 2014


Author: hselasky
Date: Fri Jan 24 07:24:40 2014
New Revision: 261096
URL: http://svnweb.freebsd.org/changeset/base/261096

Log:
  MFC r260388, r260535 and r260536:
  Fix XHCI interrupt logic for "Intel Lynx Point" found in MBP2013.

Modified:
  stable/10/sys/dev/usb/controller/xhci.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/usb/controller/xhci.c
==============================================================================
--- stable/10/sys/dev/usb/controller/xhci.c	Fri Jan 24 02:57:00 2014	(r261095)
+++ stable/10/sys/dev/usb/controller/xhci.c	Fri Jan 24 07:24:40 2014	(r261096)
@@ -1578,23 +1578,26 @@ void
 xhci_interrupt(struct xhci_softc *sc)
 {
 	uint32_t status;
+	uint32_t temp;
 
 	USB_BUS_LOCK(&sc->sc_bus);
 
 	status = XREAD4(sc, oper, XHCI_USBSTS);
-	if (status == 0)
-		goto done;
 
-	/* acknowledge interrupts */
+	/* acknowledge interrupts, if any */
+	if (status != 0) {
+		XWRITE4(sc, oper, XHCI_USBSTS, status);
+		DPRINTFN(16, "real interrupt (status=0x%08x)\n", status);
+	}
 
-	XWRITE4(sc, oper, XHCI_USBSTS, status);
+	temp = XREAD4(sc, runt, XHCI_IMAN(0));
 
-	DPRINTFN(16, "real interrupt (status=0x%08x)\n", status);
+	/* force clearing of pending interrupts */
+	if (temp & XHCI_IMAN_INTR_PEND)
+		XWRITE4(sc, runt, XHCI_IMAN(0), temp);
  
-	if (status & XHCI_STS_EINT) {
-		/* check for event(s) */
-		xhci_interrupt_poll(sc);
-	}
+	/* check for event(s) */
+	xhci_interrupt_poll(sc);
 
 	if (status & (XHCI_STS_PCD | XHCI_STS_HCH |
 	    XHCI_STS_HSE | XHCI_STS_HCE)) {
@@ -1618,7 +1621,6 @@ xhci_interrupt(struct xhci_softc *sc)
 			   __FUNCTION__);
 		}
 	}
-done:
 	USB_BUS_UNLOCK(&sc->sc_bus);
 }
 


More information about the svn-src-all mailing list