[PATCH 3/3] PCI/PM: Keep hotplug ports out of D3 if they can't signal PME from D3hot

From: Aviv Bakal

Date: Sun Nov 15 2026 - 12:19:03 EST


On runtime suspend pciehp masks the hotplug interrupt and relies on
PME to resume the port on a slot event. pci_bridge_d3_possible() does
not check whether the port can signal PME from D3hot, so a port that
cannot is not resumed by slot events.

Return false from pci_bridge_d3_possible() for such native hotplug
ports. pci_pm_init() computes bridge_d3 before it reads PME_Support,
so move that assignment after dev->pme_support is set.

Co-developed-by: Zeev Zilberman <zeev@xxxxxxxxxx>
Signed-off-by: Zeev Zilberman <zeev@xxxxxxxxxx>
Signed-off-by: Aviv Bakal <avivb@xxxxxxxxxx>
---
drivers/pci/pci.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index 1a23be4b6a07..0b2e20e781e6 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -3081,6 +3081,14 @@ bool pci_bridge_d3_possible(struct pci_dev *bridge)
if (platform_pci_bridge_d3(bridge))
return true;

+ /*
+ * pciehp masks the hotplug interrupt on runtime suspend and
+ * relies on PME to resume the port on a slot event. A port
+ * that cannot signal PME from D3hot is not resumed.
+ */
+ if (bridge->is_pciehp && !pci_pme_capable(bridge, PCI_D3hot))
+ return false;
+
/*
* Hotplug ports handled natively by the OS on x86 platforms
* were not validated by vendors for runtime D3 at least until
@@ -3247,7 +3255,6 @@ void pci_pm_init(struct pci_dev *dev)
dev->pm_cap = pm;
dev->d3hot_delay = PCI_PM_D3HOT_WAIT;
dev->d3cold_delay = PCI_PM_D3COLD_WAIT;
- dev->bridge_d3 = pci_bridge_d3_possible(dev);
dev->d3cold_allowed = true;

dev->d1_support = false;
@@ -3283,6 +3290,9 @@ void pci_pm_init(struct pci_dev *dev)
pci_pme_active(dev, false);
}

+ /* pci_bridge_d3_possible() looks at pme_support */
+ dev->bridge_d3 = pci_bridge_d3_possible(dev);
+
poweron:
pci_update_current_state(dev, PCI_UNKNOWN);
if (dev->current_state == PCI_D0) {
--
2.50.1