diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-02-19 09:06:37 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-02-19 09:06:37 +0100 |
commit | 36d97cdaf46593330067c34ed3639d0556d4fd6d (patch) | |
tree | 8f15f5dc52d5c0a045751b8dd20768bd8a11605f /drivers/pci/pci.c | |
parent | 548fcf037b3f8592e9fe41469110453a777416d6 (diff) | |
parent | b401b621758e46812da61fa58a67c3fd8d91de0d (diff) | |
download | linux-stable-36d97cdaf46593330067c34ed3639d0556d4fd6d.tar.gz linux-stable-36d97cdaf46593330067c34ed3639d0556d4fd6d.tar.bz2 linux-stable-36d97cdaf46593330067c34ed3639d0556d4fd6d.zip |
Merge 6.8-rc5 into tty-next
We need the serial/tty fixes in here as well.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/pci/pci.c')
-rw-r--r-- | drivers/pci/pci.c | 37 |
1 files changed, 22 insertions, 15 deletions
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index 9ab9b1008d8b..c3585229c12a 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -2522,29 +2522,36 @@ static void pci_pme_list_scan(struct work_struct *work) if (pdev->pme_poll) { struct pci_dev *bridge = pdev->bus->self; struct device *dev = &pdev->dev; - int pm_status; + struct device *bdev = bridge ? &bridge->dev : NULL; + int bref = 0; /* - * If bridge is in low power state, the - * configuration space of subordinate devices - * may be not accessible + * If we have a bridge, it should be in an active/D0 + * state or the configuration space of subordinate + * devices may not be accessible or stable over the + * course of the call. */ - if (bridge && bridge->current_state != PCI_D0) - continue; + if (bdev) { + bref = pm_runtime_get_if_active(bdev, true); + if (!bref) + continue; + + if (bridge->current_state != PCI_D0) + goto put_bridge; + } /* - * If the device is in a low power state it - * should not be polled either. + * The device itself should be suspended but config + * space must be accessible, therefore it cannot be in + * D3cold. */ - pm_status = pm_runtime_get_if_active(dev, true); - if (!pm_status) - continue; - - if (pdev->current_state != PCI_D3cold) + if (pm_runtime_suspended(dev) && + pdev->current_state != PCI_D3cold) pci_pme_wakeup(pdev, NULL); - if (pm_status > 0) - pm_runtime_put(dev); +put_bridge: + if (bref > 0) + pm_runtime_put(bdev); } else { list_del(&pme_dev->list); kfree(pme_dev); |