Skip to content

Commit 4a75714

Browse files
committed
Merge tag 'pci-v6.8-fixes-3' of git://git.kernel.org/pub/scm/linux/kernel/git/pci/pci
Pull pci fixes from Bjorn Helgaas: - Keep bridges in D0 if we need to poll downstream devices for PME to resolve a v6.6 regression where we failed to enumerate devices below bridges put in D3hot by runtime PM, e.g., NVMe drives connected via Thunderbolt or USB4 docks (Alex Williamson) - Add Siddharth Vadapalli as PCI TI DRA7XX/J721E reviewer * tag 'pci-v6.8-fixes-3' of git://git.kernel.org/pub/scm/linux/kernel/git/pci/pci: MAINTAINERS: Add Siddharth Vadapalli as PCI TI DRA7XX/J721E reviewer PCI: Fix active state requirement in PME polling
2 parents ad645de + 172c0cf commit 4a75714

File tree

2 files changed

+23
-15
lines changed

2 files changed

+23
-15
lines changed

MAINTAINERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16837,6 +16837,7 @@ F: drivers/pci/controller/dwc/*designware*
1683716837

1683816838
PCI DRIVER FOR TI DRA7XX/J721E
1683916839
M: Vignesh Raghavendra <vigneshr@ti.com>
16840+
R: Siddharth Vadapalli <s-vadapalli@ti.com>
1684016841
L: linux-omap@vger.kernel.org
1684116842
L: linux-pci@vger.kernel.org
1684216843
L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)

drivers/pci/pci.c

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2522,29 +2522,36 @@ static void pci_pme_list_scan(struct work_struct *work)
25222522
if (pdev->pme_poll) {
25232523
struct pci_dev *bridge = pdev->bus->self;
25242524
struct device *dev = &pdev->dev;
2525-
int pm_status;
2525+
struct device *bdev = bridge ? &bridge->dev : NULL;
2526+
int bref = 0;
25262527

25272528
/*
2528-
* If bridge is in low power state, the
2529-
* configuration space of subordinate devices
2530-
* may be not accessible
2529+
* If we have a bridge, it should be in an active/D0
2530+
* state or the configuration space of subordinate
2531+
* devices may not be accessible or stable over the
2532+
* course of the call.
25312533
*/
2532-
if (bridge && bridge->current_state != PCI_D0)
2533-
continue;
2534+
if (bdev) {
2535+
bref = pm_runtime_get_if_active(bdev, true);
2536+
if (!bref)
2537+
continue;
2538+
2539+
if (bridge->current_state != PCI_D0)
2540+
goto put_bridge;
2541+
}
25342542

25352543
/*
2536-
* If the device is in a low power state it
2537-
* should not be polled either.
2544+
* The device itself should be suspended but config
2545+
* space must be accessible, therefore it cannot be in
2546+
* D3cold.
25382547
*/
2539-
pm_status = pm_runtime_get_if_active(dev, true);
2540-
if (!pm_status)
2541-
continue;
2542-
2543-
if (pdev->current_state != PCI_D3cold)
2548+
if (pm_runtime_suspended(dev) &&
2549+
pdev->current_state != PCI_D3cold)
25442550
pci_pme_wakeup(pdev, NULL);
25452551

2546-
if (pm_status > 0)
2547-
pm_runtime_put(dev);
2552+
put_bridge:
2553+
if (bref > 0)
2554+
pm_runtime_put(bdev);
25482555
} else {
25492556
list_del(&pme_dev->list);
25502557
kfree(pme_dev);

0 commit comments

Comments
 (0)