Skip to contentSkip to conversation

xhci-pci: keep Titan Ridge active on MacBookPro15,1

PATCH In review Andre Eikmeyer 1 participant 2 messages Jul 30 – Aug 2

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xhci-pci: keep Titan Ridge active on MacBookPro15,1

On the MacBookPro15,1, the Titan Ridge xHCI controllers do not report SuperSpeed connect events after runtime suspend when the firmware follows its OSDW path. USB 2 devices routed through the PCH controller and DisplayPort continue to work, while USB 3 mass-storage hotplug remains completely silent. Writing on to the xHCI power/control attribute restores detection.

We mark the Titan Ridge 4C xHCI controllers as unable to enter D3 during xHCI quirk setup. The common xHCI PCI probe then keeps its runtime-PM reference because pci_choose_state() returns D0, so the controller remains able to report hotplug events.

The quirk is limited to the MacBookPro15,1 and has been tested on its 2018 and 2019 revisions. Suspend and repeated resume continue to work.

---
 drivers/usb/host/xhci-pci.c | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/usb/host/xhci-pci.c +7 -0
index 6b3fcba44b08..6bc1a3c786c1 100644
@@ -9,6 +9,7 @@
  */
 
 #include <linux/pci.h>
+#include <linux/dmi.h>
 #include <linux/slab.h>
 #include <linux/module.h>
 #include <linux/acpi.h>
@@ -347,6 +348,12 @@ static void xhci_pci_quirks(struct device *dev, struct xhci_hcd *xhci)
 		xhci->quirks |= XHCI_INTEL_HOST;
 		xhci->quirks |= XHCI_AVOID_BEI;
 	}
+
+	if (pdev->vendor == PCI_VENDOR_ID_INTEL &&
+	    pdev->device == PCI_DEVICE_ID_INTEL_TITAN_RIDGE_4C_XHCI &&
+	    dmi_match(DMI_PRODUCT_NAME, "MacBookPro15,1"))
+		pdev->dev_flags |= PCI_DEV_FLAGS_NO_D3;
+
 	if (pdev->vendor == PCI_VENDOR_ID_INTEL &&
 			pdev->device == PCI_DEVICE_ID_INTEL_PANTHERPOINT_XHCI) {
 		xhci->quirks |= XHCI_EP_LIMIT_QUIRK;
Signature · 1 line
2.55.0
#1 lore raw

Hello everyone,

Please disregard this patch for now.

Further testing indicates that the reported USB hotplug failure may be caused by an initialization/runtime-PM ordering race rather than by the Titan Ridge xHCI controllers being unable to enter D3.

Keeping the controllers permanently in D0 avoids the symptom, but also prevents deeper package C-states and increases idle power consumption. We are running additional tests before proposing a more appropriate fix.

We will send a revised patch if the race and its correct handling can be confirmed.

Thanks,
Andre