svn commit: r265079 - stable/9/sys/dev/usb/controller

Hans Petter Selasky hselasky at FreeBSD.org
Tue Apr 29 05:47:15 UTC 2014


Author: hselasky
Date: Tue Apr 29 05:47:13 2014
New Revision: 265079
URL: http://svnweb.freebsd.org/changeset/base/265079

Log:
  MFC r265015:
  Setting the IMOD value below 0x3F8 can cause IRQ lockups in the Intel
  LynxPoint USB 3.0 controllers found in MacBookPro 2013's.

Modified:
  stable/9/sys/dev/usb/controller/xhci.c
  stable/9/sys/dev/usb/controller/xhci.h
  stable/9/sys/dev/usb/controller/xhci_pci.c
  stable/9/sys/dev/usb/controller/xhcireg.h
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/dev/   (props changed)

Modified: stable/9/sys/dev/usb/controller/xhci.c
==============================================================================
--- stable/9/sys/dev/usb/controller/xhci.c	Tue Apr 29 05:45:17 2014	(r265078)
+++ stable/9/sys/dev/usb/controller/xhci.c	Tue Apr 29 05:47:13 2014	(r265079)
@@ -470,8 +470,12 @@ xhci_start_controller(struct xhci_softc 
 
 	XWRITE4(sc, runt, XHCI_ERSTSZ(0), XHCI_ERSTS_SET(temp));
 
+	/* Check if we should use the default IMOD value */
+	if (sc->sc_imod_default == 0)
+		sc->sc_imod_default = XHCI_IMOD_DEFAULT;
+
 	/* Setup interrupt rate */
-	XWRITE4(sc, runt, XHCI_IMOD(0), XHCI_IMOD_DEFAULT);
+	XWRITE4(sc, runt, XHCI_IMOD(0), sc->sc_imod_default);
 
 	usbd_get_page(&sc->sc_hw.root_pc, 0, &buf_res);
 

Modified: stable/9/sys/dev/usb/controller/xhci.h
==============================================================================
--- stable/9/sys/dev/usb/controller/xhci.h	Tue Apr 29 05:45:17 2014	(r265078)
+++ stable/9/sys/dev/usb/controller/xhci.h	Tue Apr 29 05:47:13 2014	(r265079)
@@ -470,6 +470,7 @@ struct xhci_softc {
 	uint16_t		sc_erst_max;
 	uint16_t		sc_event_idx;
 	uint16_t		sc_command_idx;
+	uint16_t		sc_imod_default;
 
 	uint8_t			sc_event_ccs;
 	uint8_t			sc_command_ccs;

Modified: stable/9/sys/dev/usb/controller/xhci_pci.c
==============================================================================
--- stable/9/sys/dev/usb/controller/xhci_pci.c	Tue Apr 29 05:45:17 2014	(r265078)
+++ stable/9/sys/dev/usb/controller/xhci_pci.c	Tue Apr 29 05:47:13 2014	(r265079)
@@ -226,6 +226,7 @@ xhci_pci_attach(device_t self)
 	case 0x1e318086:	/* Panther Point */
 	case 0x8c318086:	/* Lynx Point */
 		sc->sc_port_route = &xhci_pci_port_route;
+		sc->sc_imod_default = XHCI_IMOD_DEFAULT_LP;
 		break;
 	default:
 		break;

Modified: stable/9/sys/dev/usb/controller/xhcireg.h
==============================================================================
--- stable/9/sys/dev/usb/controller/xhcireg.h	Tue Apr 29 05:45:17 2014	(r265078)
+++ stable/9/sys/dev/usb/controller/xhcireg.h	Tue Apr 29 05:47:13 2014	(r265079)
@@ -166,7 +166,8 @@
 #define	XHCI_IMOD_IVAL_SET(x)	(((x) & 0xFFFF) << 0)	/* 250ns unit */
 #define	XHCI_IMOD_ICNT_GET(x)	(((x) >> 16) & 0xFFFF)	/* 250ns unit */
 #define	XHCI_IMOD_ICNT_SET(x)	(((x) & 0xFFFF) << 16)	/* 250ns unit */
-#define	XHCI_IMOD_DEFAULT	0x000001F4U	/* 8000 IRQ/second */
+#define	XHCI_IMOD_DEFAULT	0x000001F4U	/* 8000 IRQs/second */
+#define	XHCI_IMOD_DEFAULT_LP 	0x000003F8U	/* 4000 IRQs/second - LynxPoint */
 #define	XHCI_ERSTSZ(n)		(0x0028 + (0x20 * (n)))	/* XHCI event ring segment table size */
 #define	XHCI_ERSTS_GET(x)	((x) & 0xFFFF)
 #define	XHCI_ERSTS_SET(x)	((x) & 0xFFFF)


More information about the svn-src-stable-9 mailing list