Skip to content

Commit 0e00392

Browse files
committed
PCI: PM: Enable PME if it can be signaled from D3cold
PME signaling is only enabled by __pci_enable_wake() if the target device can signal PME from the given target power state (to avoid pointless reconfiguration of the device), but if the hierarchy above the device goes into D3cold, the device itself will end up in D3cold too, so if it can signal PME from D3cold, it should be enabled to do so in __pci_enable_wake(). [Note that if the device does not end up in D3cold and it cannot signal PME from the original target power state, it will not signal PME, so in that case the behavior does not change.] Link: https://lore.kernel.org/linux-pm/3149540.aeNJFYEL58@kreacher/ Fixes: 5bcc2fb ("PCI PM: Simplify PCI wake-up code") Reported-by: Mika Westerberg <[email protected]> Reported-by: Utkarsh H Patel <[email protected]> Reported-by: Koba Ko <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]> Reviewed-by: Mika Westerberg <[email protected]> Tested-by: Mika Westerberg <[email protected]>
1 parent da9f215 commit 0e00392

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

drivers/pci/pci.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2491,7 +2491,14 @@ static int __pci_enable_wake(struct pci_dev *dev, pci_power_t state, bool enable
24912491
if (enable) {
24922492
int error;
24932493

2494-
if (pci_pme_capable(dev, state))
2494+
/*
2495+
* Enable PME signaling if the device can signal PME from
2496+
* D3cold regardless of whether or not it can signal PME from
2497+
* the current target state, because that will allow it to
2498+
* signal PME when the hierarchy above it goes into D3cold and
2499+
* the device itself ends up in D3cold as a result of that.
2500+
*/
2501+
if (pci_pme_capable(dev, state) || pci_pme_capable(dev, PCI_D3cold))
24952502
pci_pme_active(dev, true);
24962503
else
24972504
ret = 1;

0 commit comments

Comments
 (0)