PCI: d4c79b63d82d4 "Allow D3 for native Hotplug capable Root Ports on non-x86" silently breaks surprise hotplug on empty slots
Hi Bjorn, Manivannan,
Commit d4c79b63d82d4 ("PCI: Allow D3 for native Hotplug capable Root Ports on non-x86 platforms") breaks surprise hotplug on empty slots on AWS Graviton bare metal. I didn't find this failure mode covered in the existing discussion, but am leaving links to related reports at the end.
Observation (m7g.metal, aarch64, native PCIe hotplug via _OSC): ENI (Elastic Network Interface) attachment hot-adds an ENA NIC behind one of the hotplug-capable Switch Downstream Ports, which are all empty at boot. Since d4c79b63d82d4, those ports runtime-suspend to D3hot shortly after boot (all 45 empty ports report "suspended" in power/runtime_status), and a subsequent ENI attach produces no event at all: no "Card present" from pciehp, no ACPI/GPE activity, no new device, no error anywhere. Ports with live children stay awake, so only devices attached after boot are affected.
The device itself is fully present behind the suspended port: with the ENI attached and the event lost, a manual
echo 1 > /sys/bus/pci/rescan
enumerates and probes it normally. So the hot-add completes in hardware, but we lose the event delivery. From code reading, the port suspends with the hotplug interrupt disabled (pciehp_runtime_suspend() -> pciehp_disable_interrupt()) and nothing wakes a port with an empty slot.
Functionality works on 7.2. It also works if I manually disable D3 via pcie_port_pm=off and if I revert d4c79b63d82d4.
kernel empty ports result
------------------------------------------ ------------- ----------
7.2-based (before this commit) active PASS 7.3-based (contains this commit) suspended FAIL 7.3-based + pcie_port_pm=off active PASS 7.3-based, only this commit reverted active PASS
This failure reproduces deterministically in our CI.
Related reports referencing this commit:
- system suspend crash on Qualcomm SC8280XP CRD:
https://lore.kernel.org/all/[email protected]/
- commit recommended as a D3cold fix in the qcom hotplug thread:
https://lore.kernel.org/linux-pci/[email protected]/
Happy to try out any suggestions on how to proceed fixing this.
Best,
Bjoern
Hi again,
turns out I missed that our colleagues from the ENA side already submitted a series to fix this:
https://lore.kernel.org/all/[email protected]/
I confirmed this fixes my observed behavior.
Sorry for the noise.
Best,
Bjoern