Re: [PATCH v2] xhci: Allow RPM on the USB controller (1022:43f7) by default

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 26.2.2024 17.28, Basavaraj Natikar wrote:
The AMD USB host controller (1022:43f7) does not enter PCI D3 by default
when nothing is connected. This is due to the policy introduced by
'commit a611bf473d1f ("xhci-pci: Set runtime PM as default policy on all
xHC 1.2 or later devices")', which only covers 1.2 or later devices.

This makes it seem like commit a611bf473d1 somehow restricted default runtime
PM when in fact it enabled it for all xHCI 1.2 hosts.

Before that only a few selected ones had runtime PM enabled by default.

How about something like:

Enable runtime PM by default for older AMD 1022:43f7 xHCI 1.1 host as it is
proven to work.
Driver enables runtime PM by default for newer xHCI 1.2 host.


Therefore, by default, allow RPM on the AMD USB controller [1022:43f7].

Fixes: 4baf12181509 ("xhci: Loosen RPM as default policy to cover for AMD xHC 1.1")

This was already reverted as it caused regression on some systems.
24be0b3c4059 Revert "xhci: Loosen RPM as default policy to cover for AMD xHC 1.1"

Link: https://lore.kernel.org/all/12335218.O9o76ZdvQC@xxxxxxxxxxxxxx/
Cc: Mario Limonciello <mario.limonciello@xxxxxxx>
Cc: stable@xxxxxxxxxxxxxxx

I'd skip Fixes and stable tags and add this as a feature to usb-next.

Tested-by: Oleksandr Natalenko <oleksandr@xxxxxxxxxxxxxx>
Signed-off-by: Basavaraj Natikar <Basavaraj.Natikar@xxxxxxx>
---
Changes in v2:
	- Added Cc: stable@xxxxxxxxxxxxxxx

  drivers/usb/host/xhci-pci.c | 2 ++
  1 file changed, 2 insertions(+)

diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c
index b534ca9752be..1eb7a41a75d7 100644
--- a/drivers/usb/host/xhci-pci.c
+++ b/drivers/usb/host/xhci-pci.c
@@ -473,6 +473,8 @@ static void xhci_pci_quirks(struct device *dev, struct xhci_hcd *xhci)
  	/* xHC spec requires PCI devices to support D3hot and D3cold */
  	if (xhci->hci_version >= 0x120)
  		xhci->quirks |= XHCI_DEFAULT_PM_RUNTIME_ALLOW;
+	else if (pdev->vendor == PCI_VENDOR_ID_AMD && pdev->device == 0x43f7)
+		xhci->quirks |= XHCI_DEFAULT_PM_RUNTIME_ALLOW;

This would fit better earlier in the code among the rest of the AMD quirks.
See how this flag is set for some other hosts.

Thanks
Mathias





[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux