Skip to content

Commit d165826

Browse files
superm1gregkh
authored andcommitted
usb: pci-quirks: disable D3cold on xhci suspend for s2idle on AMD Renoir
The XHCI controller is required to enter D3hot rather than D3cold for AMD s2idle on this hardware generation. Otherwise, the 'Controller Not Ready' (CNR) bit is not being cleared by host in resume and eventually this results in xhci resume failures during the s2idle wakeup. Link: https://lore.kernel.org/linux-usb/[email protected]/ Suggested-by: Prike Liang <[email protected]> Signed-off-by: Mario Limonciello <[email protected]> Cc: stable <[email protected]> # 5.11+ Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 1958ff5 commit d165826

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

drivers/usb/host/xhci-pci.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
#define PCI_DEVICE_ID_INTEL_MAPLE_RIDGE_XHCI 0x1138
6060
#define PCI_DEVICE_ID_INTEL_ALDER_LAKE_XHCI 0x461e
6161

62+
#define PCI_DEVICE_ID_AMD_RENOIR_XHCI 0x1639
6263
#define PCI_DEVICE_ID_AMD_PROMONTORYA_4 0x43b9
6364
#define PCI_DEVICE_ID_AMD_PROMONTORYA_3 0x43ba
6465
#define PCI_DEVICE_ID_AMD_PROMONTORYA_2 0x43bb
@@ -182,6 +183,10 @@ static void xhci_pci_quirks(struct device *dev, struct xhci_hcd *xhci)
182183
(pdev->device == PCI_DEVICE_ID_AMD_PROMONTORYA_1)))
183184
xhci->quirks |= XHCI_U2_DISABLE_WAKE;
184185

186+
if (pdev->vendor == PCI_VENDOR_ID_AMD &&
187+
pdev->device == PCI_DEVICE_ID_AMD_RENOIR_XHCI)
188+
xhci->quirks |= XHCI_BROKEN_D3COLD;
189+
185190
if (pdev->vendor == PCI_VENDOR_ID_INTEL) {
186191
xhci->quirks |= XHCI_LPM_SUPPORT;
187192
xhci->quirks |= XHCI_INTEL_HOST;
@@ -539,7 +544,7 @@ static int xhci_pci_suspend(struct usb_hcd *hcd, bool do_wakeup)
539544
* Systems with the TI redriver that loses port status change events
540545
* need to have the registers polled during D3, so avoid D3cold.
541546
*/
542-
if (xhci->quirks & XHCI_COMP_MODE_QUIRK)
547+
if (xhci->quirks & (XHCI_COMP_MODE_QUIRK | XHCI_BROKEN_D3COLD))
543548
pci_d3cold_disable(pdev);
544549

545550
if (xhci->quirks & XHCI_PME_STUCK_QUIRK)

drivers/usb/host/xhci.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1892,6 +1892,7 @@ struct xhci_hcd {
18921892
#define XHCI_DISABLE_SPARSE BIT_ULL(38)
18931893
#define XHCI_SG_TRB_CACHE_SIZE_QUIRK BIT_ULL(39)
18941894
#define XHCI_NO_SOFT_RETRY BIT_ULL(40)
1895+
#define XHCI_BROKEN_D3COLD BIT_ULL(41)
18951896

18961897
unsigned int num_active_eps;
18971898
unsigned int limit_active_eps;

0 commit comments

Comments
 (0)