Skip to contentSkip to conversation

xhci-pci: Set runtime PM as default policy on all xHC 1.2 or later devices

PATCH In review Mario Limonciello 3 participants 6 messages Oct 10, 2022 – Oct 12, 2022

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

PATCH v3 1/1 xhci-pci: Set runtime PM as default policy on all xHC 1.2 or later devices

For optimal power consumption of USB4 routers the XHCI PCIe endpoint used for tunneling must be in D3. Historically this is accomplished by a long list of PCIe IDs that correspond to these endpoints because the xhci_hcd driver will not default to allowing runtime PM for all devices.

As both AMD and Intel have released new products with new XHCI controllers this list continues to grow. In reviewing the XHCI specification v1.2 on page 607 there is already a requirement that the PCI power management states D3hot and D3cold must be supported.

In the quirk list, use this to indicate that runtime PM should be allowed on XHCI controllers. The following controllers are known to be xHC 1.2 and dropped explicitly:
* AMD Yellow Carp
* Intel Alder Lake
* Intel Meteor Lake
* Intel Raptor Lake

---
v2->v3:
* Add a comment for future discovery (Mika)
* Correct version from 0x102 to 0x120 (Mathias)
* Drop some Intel controllers too (Mathias)
* Drop second patch (Mathias)

---
 drivers/usb/host/xhci-pci.c | 31 +++----------------------------
 1 file changed, 3 insertions(+), 28 deletions(-)
drivers/usb/host/xhci-pci.c +3 -28
index dce6c0ec8d340..fd6f2698b3ea4 100644
@@ -58,25 +58,12 @@
 #define PCI_DEVICE_ID_INTEL_CML_XHCI			0xa3af
 #define PCI_DEVICE_ID_INTEL_TIGER_LAKE_XHCI		0x9a13
 #define PCI_DEVICE_ID_INTEL_MAPLE_RIDGE_XHCI		0x1138
-#define PCI_DEVICE_ID_INTEL_ALDER_LAKE_XHCI		0x461e
-#define PCI_DEVICE_ID_INTEL_ALDER_LAKE_N_XHCI		0x464e
-#define PCI_DEVICE_ID_INTEL_ALDER_LAKE_PCH_XHCI	0x51ed
-#define PCI_DEVICE_ID_INTEL_RAPTOR_LAKE_XHCI		0xa71e
-#define PCI_DEVICE_ID_INTEL_METEOR_LAKE_XHCI		0x7ec0
 
 #define PCI_DEVICE_ID_AMD_RENOIR_XHCI			0x1639
 #define PCI_DEVICE_ID_AMD_PROMONTORYA_4			0x43b9
 #define PCI_DEVICE_ID_AMD_PROMONTORYA_3			0x43ba
 #define PCI_DEVICE_ID_AMD_PROMONTORYA_2			0x43bb
 #define PCI_DEVICE_ID_AMD_PROMONTORYA_1			0x43bc
-#define PCI_DEVICE_ID_AMD_YELLOW_CARP_XHCI_1		0x161a
-#define PCI_DEVICE_ID_AMD_YELLOW_CARP_XHCI_2		0x161b
-#define PCI_DEVICE_ID_AMD_YELLOW_CARP_XHCI_3		0x161d
-#define PCI_DEVICE_ID_AMD_YELLOW_CARP_XHCI_4		0x161e
-#define PCI_DEVICE_ID_AMD_YELLOW_CARP_XHCI_5		0x15d6
-#define PCI_DEVICE_ID_AMD_YELLOW_CARP_XHCI_6		0x15d7
-#define PCI_DEVICE_ID_AMD_YELLOW_CARP_XHCI_7		0x161c
-#define PCI_DEVICE_ID_AMD_YELLOW_CARP_XHCI_8		0x161f
 
 #define PCI_DEVICE_ID_ASMEDIA_1042_XHCI			0x1042
 #define PCI_DEVICE_ID_ASMEDIA_1042A_XHCI		0x1142
@@ -268,12 +255,7 @@ static void xhci_pci_quirks(struct device *dev, struct xhci_hcd *xhci)
 	     pdev->device == PCI_DEVICE_ID_INTEL_TITAN_RIDGE_DD_XHCI ||
 	     pdev->device == PCI_DEVICE_ID_INTEL_ICE_LAKE_XHCI ||
 	     pdev->device == PCI_DEVICE_ID_INTEL_TIGER_LAKE_XHCI ||
-	     pdev->device == PCI_DEVICE_ID_INTEL_MAPLE_RIDGE_XHCI ||
-	     pdev->device == PCI_DEVICE_ID_INTEL_ALDER_LAKE_XHCI ||
-	     pdev->device == PCI_DEVICE_ID_INTEL_ALDER_LAKE_N_XHCI ||
-	     pdev->device == PCI_DEVICE_ID_INTEL_ALDER_LAKE_PCH_XHCI ||
-	     pdev->device == PCI_DEVICE_ID_INTEL_RAPTOR_LAKE_XHCI ||
-	     pdev->device == PCI_DEVICE_ID_INTEL_METEOR_LAKE_XHCI))
+	     pdev->device == PCI_DEVICE_ID_INTEL_MAPLE_RIDGE_XHCI))
 		xhci->quirks |= XHCI_DEFAULT_PM_RUNTIME_ALLOW;
 
 	if (pdev->vendor == PCI_VENDOR_ID_ETRON &&
@@ -336,15 +318,8 @@ static void xhci_pci_quirks(struct device *dev, struct xhci_hcd *xhci)
 	     pdev->device == PCI_DEVICE_ID_AMD_PROMONTORYA_4))
 		xhci->quirks |= XHCI_NO_SOFT_RETRY;
 
-	if (pdev->vendor == PCI_VENDOR_ID_AMD &&
-	    (pdev->device == PCI_DEVICE_ID_AMD_YELLOW_CARP_XHCI_1 ||
-	    pdev->device == PCI_DEVICE_ID_AMD_YELLOW_CARP_XHCI_2 ||
-	    pdev->device == PCI_DEVICE_ID_AMD_YELLOW_CARP_XHCI_3 ||
-	    pdev->device == PCI_DEVICE_ID_AMD_YELLOW_CARP_XHCI_4 ||
-	    pdev->device == PCI_DEVICE_ID_AMD_YELLOW_CARP_XHCI_5 ||
-	    pdev->device == PCI_DEVICE_ID_AMD_YELLOW_CARP_XHCI_6 ||
-	    pdev->device == PCI_DEVICE_ID_AMD_YELLOW_CARP_XHCI_7 ||
-	    pdev->device == PCI_DEVICE_ID_AMD_YELLOW_CARP_XHCI_8))
+	/* xHC spec requires PCI devices to support D3hot and D3cold */
+	if (xhci->hci_version >= 0x120)
 		xhci->quirks |= XHCI_DEFAULT_PM_RUNTIME_ALLOW;
 
 	if (xhci->quirks & XHCI_RESET_ON_RESUME)
Signature · 1 line
2.34.1
Reviewed-by on v3 1/1
#1 lore raw
Quoted 19 lines · Mario Limonciello

For optimal power consumption of USB4 routers the XHCI PCIe endpoint used for tunneling must be in D3. Historically this is accomplished by a long list of PCIe IDs that correspond to these endpoints because the xhci_hcd driver will not default to allowing runtime PM for all devices.

As both AMD and Intel have released new products with new XHCI controllers this list continues to grow. In reviewing the XHCI specification v1.2 on page 607 there is already a requirement that the PCI power management states D3hot and D3cold must be supported.

In the quirk list, use this to indicate that runtime PM should be allowed on XHCI controllers. The following controllers are known to be xHC 1.2 and dropped explicitly:
* AMD Yellow Carp
* Intel Alder Lake
* Intel Meteor Lake
* Intel Raptor Lake

Quoted 3 lines
#2 lore raw
Quoted 20 lines · Mika Westerberg
Quoted 19 lines · Mario Limonciello

For optimal power consumption of USB4 routers the XHCI PCIe endpoint used for tunneling must be in D3. Historically this is accomplished by a long list of PCIe IDs that correspond to these endpoints because the xhci_hcd driver will not default to allowing runtime PM for all devices.

As both AMD and Intel have released new products with new XHCI controllers this list continues to grow. In reviewing the XHCI specification v1.2 on page 607 there is already a requirement that the PCI power management states D3hot and D3cold must be supported.

In the quirk list, use this to indicate that runtime PM should be allowed on XHCI controllers. The following controllers are known to be xHC 1.2 and dropped explicitly:
* AMD Yellow Carp
* Intel Alder Lake
* Intel Meteor Lake
* Intel Raptor Lake

Quoted 5 lines
Quoted 3 lines

Thanks, added to queue

-Mathias

#3 lore raw

[Public]

Quoted 45 lines

-----Original Message-----
From: Mathias Nyman <[email protected]>
Sent: Tuesday, October 11, 2022 08:16
To: Mika Westerberg <[email protected]>; Limonciello, Mario <[email protected]>
Cc: Mathias Nyman <[email protected]>; Mehta, Sanju <[email protected]>; Greg Kroah-Hartman <[email protected]>; [email protected]; linux- [email protected]
Subject: Re: [PATCH v3] xhci-pci: Set runtime PM as default policy on all xHC 1.2 or later devices

Quoted 8 lines · Mika Westerberg
Quoted 7 lines · Mario Limonciello

For optimal power consumption of USB4 routers the XHCI PCIe endpoint used for tunneling must be in D3. Historically this is accomplished by a long list of PCIe IDs that correspond to these endpoints because the xhci_hcd driver will not default to allowing runtime PM for all devices.

As both AMD and Intel have released new products with new XHCI

controllers

Quoted 12 lines
Quoted 12 lines

this list continues to grow. In reviewing the XHCI specification v1.2 on page 607 there is already a requirement that the PCI power management states D3hot and D3cold must be supported.

In the quirk list, use this to indicate that runtime PM should be allowed on XHCI controllers. The following controllers are known to be xHC 1.2 and dropped explicitly:
* AMD Yellow Carp
* Intel Alder Lake
* Intel Meteor Lake
* Intel Raptor Lake

Quoted 2 lines
Quoted 2 lines

Link:

https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fww
w.intel.com%2Fcontent%2Fdam%2Fwww%2Fpublic%2Fus%2Fen%2Fdocum ents%2Ftechnical-specifications%2Fextensible-host-controler-interface-usb- xhci.pdf&amp;data=05%7C01%7Cmario.limonciello%40amd.com%7Cb286e9c 63e9e4c3a1a3708daab8a9b23%7C3dd8961fe4884e608e11a82d994e183d%7C0 %7C0%7C638010909687542135%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC 4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000% 7C%7C%7C&amp;sdata=CetIs1VuAqj8nNBoLnXaGncw6Sl4JcImYY67JpVxyjg% 3D&amp;reserved=0

Quoted 5 lines
Quoted 3 lines
Quoted 1 line

Thanks, added to queue

Thanks!
For my own clarity - is this something you'll still take to 6.1, or are you meaning 6.2 queue at this point?

This thread originated from enabling Pink Sardine. Wherever it lands after it's baked for $long_enough I would like to bring it back to stable eventually too. If you think it's too risky for stable later on, can we do separate set of commits that adds and then removes the IDs for pink sardine that can go to stable? This would at least mirror more closely what has been done historically for the other USB4 products.

#4 lore raw
Quoted 49 lines · Mario

[Public]

Quoted 47 lines

-----Original Message-----
From: Mathias Nyman <[email protected]>
Sent: Tuesday, October 11, 2022 08:16
To: Mika Westerberg <[email protected]>; Limonciello, Mario <[email protected]>
Cc: Mathias Nyman <[email protected]>; Mehta, Sanju <[email protected]>; Greg Kroah-Hartman <[email protected]>; [email protected]; linux- [email protected]
Subject: Re: [PATCH v3] xhci-pci: Set runtime PM as default policy on all xHC 1.2 or later devices

Quoted 8 lines · Mika Westerberg
Quoted 7 lines · Mario Limonciello

For optimal power consumption of USB4 routers the XHCI PCIe endpoint used for tunneling must be in D3. Historically this is accomplished by a long list of PCIe IDs that correspond to these endpoints because the xhci_hcd driver will not default to allowing runtime PM for all devices.

As both AMD and Intel have released new products with new XHCI

controllers

Quoted 12 lines
Quoted 12 lines

this list continues to grow. In reviewing the XHCI specification v1.2 on page 607 there is already a requirement that the PCI power management states D3hot and D3cold must be supported.

In the quirk list, use this to indicate that runtime PM should be allowed on XHCI controllers. The following controllers are known to be xHC 1.2 and dropped explicitly:
* AMD Yellow Carp
* Intel Alder Lake
* Intel Meteor Lake
* Intel Raptor Lake

Quoted 2 lines
Quoted 2 lines

Link:

https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fww
w.intel.com%2Fcontent%2Fdam%2Fwww%2Fpublic%2Fus%2Fen%2Fdocum ents%2Ftechnical-specifications%2Fextensible-host-controler-interface-usb- xhci.pdf&amp;data=05%7C01%7Cmario.limonciello%40amd.com%7Cb286e9c 63e9e4c3a1a3708daab8a9b23%7C3dd8961fe4884e608e11a82d994e183d%7C0 %7C0%7C638010909687542135%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC 4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000% 7C%7C%7C&amp;sdata=CetIs1VuAqj8nNBoLnXaGncw6Sl4JcImYY67JpVxyjg% 3D&amp;reserved=0

Quoted 2 lines
Quoted 1 line
Quoted 7 lines
Quoted 3 lines
Quoted 1 line

Thanks, added to queue

Thanks!
For my own clarity - is this something you'll still take to 6.1, or are you meaning 6.2 queue at this point?

Was planning on sending it to usb-next after 6.1-rc1 is out, so ending up in 6.2 But if there's some benefit in having this already in 6.1 then I don't object that either.

Quoted 7 lines

This thread originated from enabling Pink Sardine. Wherever it lands after it's baked for $long_enough I would like to bring it back to stable eventually too. If you think it's too risky for stable later on, can we do separate set of commits that adds and then removes the IDs for pink sardine that can go to stable? This would at least mirror more closely what has been done historically for the other USB4 products.

I think we can add this to stable. It's fine for Intel xHCI 1.2 hosts.

Thanks
-Mathias

#5 lore raw
Quoted 52 lines · Mathias Nyman
Quoted 51 lines · Mario

[Public]

Quoted 49 lines

-----Original Message-----
From: Mathias Nyman <[email protected]>
Sent: Tuesday, October 11, 2022 08:16
To: Mika Westerberg <[email protected]>; Limonciello, Mario <[email protected]>
Cc: Mathias Nyman <[email protected]>; Mehta, Sanju <[email protected]>; Greg Kroah-Hartman <[email protected]>; [email protected]; linux- [email protected]
Subject: Re: [PATCH v3] xhci-pci: Set runtime PM as default policy on all xHC 1.2 or later devices

Quoted 8 lines · Mika Westerberg
Quoted 7 lines · Mario Limonciello

For optimal power consumption of USB4 routers the XHCI PCIe endpoint used for tunneling must be in D3.  Historically this is accomplished by a long list of PCIe IDs that correspond to these endpoints because the xhci_hcd driver will not default to allowing runtime PM for all devices.

As both AMD and Intel have released new products with new XHCI

controllers

Quoted 12 lines
Quoted 12 lines

this list continues to grow. In reviewing the XHCI specification v1.2 on page 607 there is already a requirement that the PCI power management states D3hot and D3cold must be supported.

In the quirk list, use this to indicate that runtime PM should be allowed on XHCI controllers. The following controllers are known to be xHC 1.2 and dropped explicitly:
* AMD Yellow Carp
* Intel Alder Lake
* Intel Meteor Lake
* Intel Raptor Lake

Quoted 2 lines
Quoted 2 lines

Link:

https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fww
w.intel.com%2Fcontent%2Fdam%2Fwww%2Fpublic%2Fus%2Fen%2Fdocum ents%2Ftechnical-specifications%2Fextensible-host-controler-interface-usb- xhci.pdf&amp;data=05%7C01%7Cmario.limonciello%40amd.com%7Cb286e9c 63e9e4c3a1a3708daab8a9b23%7C3dd8961fe4884e608e11a82d994e183d%7C0 %7C0%7C638010909687542135%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC 4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000% 7C%7C%7C&amp;sdata=CetIs1VuAqj8nNBoLnXaGncw6Sl4JcImYY67JpVxyjg% 3D&amp;reserved=0

Quoted 3 lines
Quoted 1 line
Quoted 9 lines
Quoted 5 lines
Quoted 1 line

Thanks, added to queue

Thanks!
For my own clarity - is this something you'll still take to 6.1, or are you meaning 6.2 queue at this point?

Was planning on sending it to usb-next after 6.1-rc1 is out, so ending up in 6.2 But if there's some benefit in having this already in 6.1 then I don't object that either.

It's a blocker causing higher power consumption on some of the affected platforms. So if you're amenable, I would like to see it for 6.1 so these things have a better chance at passing energy certifications.

Quoted 10 lines
Quoted 7 lines

This thread originated from enabling Pink Sardine.  Wherever it lands after it's baked for $long_enough I would like to bring it back to stable eventually too. If you think it's too risky for stable later on, can we do separate set of commits that adds and then removes the IDs for pink sardine that can go to stable?  This would at least mirror more closely what has been done historically for the other USB4 products.

I think we can add this to stable. It's fine for Intel xHCI 1.2 hosts.

OK thanks.