[PATCH RFC 0/3] PCI: Allow a device more time for its link to return after a reset

From: Brett Creeley

Date: Wed Dec 02 2026 - 19:43:51 EST


When the SoC of an AMD Pensando Vulcano 800 AI NIC is reset, for example
when the card's management controller power-cycles it after a fatal
error, its link stays down for up to ~12 seconds. The Root Port sees a
Surprise Down and DPC contains the port, but after releasing DPC,
pci_bridge_wait_for_secondary_bus() waits only 1 s for the link to come
back. Recovery fails and the card is disconnected, even though it would
have returned. In the power-cycle case the card is unpowered for most
of the outage, so its firmware cannot keep the link up.

PCIe r5.0 sec 6.6.1 requires that, within 1.0 s of a Conventional Reset,
a device can receive a Configuration Request and return a Successful
Completion, independent of how quickly link training completes. A link
that is still down after ~12 s cannot meet that, so this is handled as a
device erratum. The Readiness Time Reporting Extended Capability cannot
express it: its times are capped at about 1.006 s and only shorten the
spec-mandated waits. This follows Lukas' suggestion that hardware which
doesn't meet the spec gets a quirk that raises the timeout for that
device, rather than a blanket increase [1].

Patch 1 adds PCI_VENDOR_ID_PENSANDO to pci_ids.h.

Patch 2 adds pci_dev->link_up_timeout, which a quirk can set. When
waiting for the secondary bus after a reset, the core uses the largest
value of the devices on that bus. The value lives in the child's struct
pci_dev, so it is still available while the device's config space is
unreachable during DPC. Devices without the quirk keep the existing 1 s
timeout. Ports at or below 5 GT/s, and ports without link active
reporting (which can only sleep, not poll), are unchanged.

This complements d3cold_delay rather than duplicating it: on this path
d3cold_delay is the wait after the link is up, before the device is
accessed, whereas link_up_timeout bounds how long the link may take to
come up in the first place.

Patch 3 sets 20 s for the Vulcano upstream port.

Questions for this RFC:

- Is a device quirk the right place for this, rather than having the
device's driver set the value at probe? A quirk covers the card even
when no driver is bound to its functions, and it is set before any
driver probes.
- Should the core cap link_up_timeout (e.g. at
PCIE_RESET_READY_POLL_MS), or is the quirk's value trusted as is?
- Hotplug-capable slots are not handled yet. Vulcano cards are deployed
in slots that support hotplug, and there pciehp waits only 4 s in
pci_dpc_recovered() for DPC recovery before treating the Link Down as
a removal, so a ~12 s outage still ends in the card being torn down.
That wait covers the DPC recovery which, with this series, already
includes link_up_timeout, so one possible approach is to reuse the
same field: have pci_dpc_recovered() extend its 4 s by the amount a
quirked device below the port adds to the link-up wait, leaving other
devices unchanged. Bjorn has suggested instead that this wait match
PCIE_RESET_READY_POLL_MS for everyone [2]. Which would you prefer?
This part is not implemented or tested yet.
- Ports at or below 5 GT/s still use the fixed 1 s budget. Is it worth
extending that path too, or is it fine to leave it until a device
needs it?

Testing: on systems with a Vulcano 800 AI NIC in slots without hotplug,
resetting the card's SoC keeps the link down for ~12 s. Without this
series, DPC recovery fails and the card is disconnected; with it, the
link returns within the extended wait and DPC recovery succeeds.

[1] https://lore.kernel.org/linux-pci/awIScN3rXFv6v9x2@xxxxxxxxx/
[2] https://lore.kernel.org/linux-pci/20250806213409.GA19037@bhelgaas/

Signed-off-by: Brett Creeley <brett.creeley@xxxxxxx>
---
Brett Creeley (3):
PCI: Add PCI_VENDOR_ID_PENSANDO
PCI: Allow quirks to extend the link-up wait after reset
PCI: Extend link-up timeout for AMD Pensando Vulcano upstream port

drivers/pci/pci.c | 73 +++++++++++++++++++++++++++++++++++++++++--------
drivers/pci/quirks.c | 13 +++++++++
include/linux/pci.h | 1 +
include/linux/pci_ids.h | 2 ++
4 files changed, 78 insertions(+), 11 deletions(-)
---
base-commit: 85a0cf7926b9e6883cbc515b8b5f77090d3b1889
change-id: 20261202-b4-pci-link-up-timeout-07f7ebc95747

Best regards,
--
Brett Creeley <brett.creeley@xxxxxxx>