Skip to content

Commit a5d6264

Browse files
basuamdgregkh
authored andcommitted
xhci: Enable RPM on controllers that support low-power states
Use the low-power states of the underlying platform to enable runtime PM. If the platform doesn't support runtime D3, then enabling default RPM will result in the controller malfunctioning, as in the case of hotplug devices not being detected because of a failed interrupt generation. Cc: Mario Limonciello <mario.limonciello@amd.com> Signed-off-by: Basavaraj Natikar <Basavaraj.Natikar@amd.com> Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com> Link: https://lore.kernel.org/r/20231019102924.2797346-16-mathias.nyman@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 4baf121 commit a5d6264

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/usb/host/xhci-pci.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -695,7 +695,9 @@ static int xhci_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
695695
/* USB-2 and USB-3 roothubs initialized, allow runtime pm suspend */
696696
pm_runtime_put_noidle(&dev->dev);
697697

698-
if (xhci->quirks & XHCI_DEFAULT_PM_RUNTIME_ALLOW)
698+
if (pci_choose_state(dev, PMSG_SUSPEND) == PCI_D0)
699+
pm_runtime_forbid(&dev->dev);
700+
else if (xhci->quirks & XHCI_DEFAULT_PM_RUNTIME_ALLOW)
699701
pm_runtime_allow(&dev->dev);
700702

701703
dma_set_max_seg_size(&dev->dev, UINT_MAX);

0 commit comments

Comments
 (0)