Skip to content

Commit 5afc2f7

Browse files
khfengbjorn-helgaas
authored andcommitted
PCI/AER: Disable AER service on suspend
If the link is powered off during suspend, electrical noise may cause errors that are logged via AER. If the AER interrupt is enabled and shares an IRQ with PME, that causes a spurious wakeup during suspend. Disable the AER interrupt during suspend to prevent this. Clear error status before re-enabling IRQ interrupts during resume so we don't get an interrupt for errors that occurred during the suspend/resume process. Link: https://bugzilla.kernel.org/show_bug.cgi?id=209149 Link: https://bugzilla.kernel.org/show_bug.cgi?id=216295 Link: https://bugzilla.kernel.org/show_bug.cgi?id=218090 Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Kai-Heng Feng <[email protected]> [bhelgaas: drop pci_ancestor_pr3_present() etc, commit log] Signed-off-by: Bjorn Helgaas <[email protected]>
1 parent 1613e60 commit 5afc2f7

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

drivers/pci/pcie/aer.c

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1497,6 +1497,22 @@ static int aer_probe(struct pcie_device *dev)
14971497
return 0;
14981498
}
14991499

1500+
static int aer_suspend(struct pcie_device *dev)
1501+
{
1502+
struct aer_rpc *rpc = get_service_data(dev);
1503+
1504+
aer_disable_rootport(rpc);
1505+
return 0;
1506+
}
1507+
1508+
static int aer_resume(struct pcie_device *dev)
1509+
{
1510+
struct aer_rpc *rpc = get_service_data(dev);
1511+
1512+
aer_enable_rootport(rpc);
1513+
return 0;
1514+
}
1515+
15001516
/**
15011517
* aer_root_reset - reset Root Port hierarchy, RCEC, or RCiEP
15021518
* @dev: pointer to Root Port, RCEC, or RCiEP
@@ -1561,6 +1577,8 @@ static struct pcie_port_service_driver aerdriver = {
15611577
.service = PCIE_PORT_SERVICE_AER,
15621578

15631579
.probe = aer_probe,
1580+
.suspend = aer_suspend,
1581+
.resume = aer_resume,
15641582
.remove = aer_remove,
15651583
};
15661584

0 commit comments

Comments
 (0)