Re: [PATCH v2] PCI/DPC: Increase recovery timeout to 60 seconds
From: Lukas Wunner
Date: Fri Dec 04 2026 - 05:44:52 EST
[cc += Brett]
On Fri, Nov 06, 2026 at 04:56:55PM +0800, Ziyou Wang (Lenovo) wrote:
> +++ b/drivers/pci/pci.c
> @@ -80,7 +80,6 @@ struct pci_pme_device {
> * limit, but 60 sec ought to be enough for any device to become
> * responsive.
> */
> -#define PCIE_RESET_READY_POLL_MS 60000 /* msec */
Please delete the code comment above the #define (since you're
moving it to drivers/pci/pci.h).
> +++ b/drivers/pci/pcie/dpc.c
> @@ -116,12 +116,13 @@ bool pci_dpc_recovered(struct pci_dev *pdev)
> return false;
>
> /*
> - * Need a timeout in case DPC never completes due to failure of
> - * dpc_wait_rp_inactive(). The spec doesn't mandate a time limit,
> - * but reports indicate that DPC completes within 4 seconds.
> + * Wait for DPC recovery completion. Use PCIE_RESET_READY_POLL_MS
> + * (60s) to match pci_dev_wait() timeout. Some devices need >5 seconds
> + * to recover after DPC containment. The 4 second timeout is too short.
> */
After this patch is applied, nobody will understand "The 4 second
timeout is too short" unless they dig around in the git history.
The "(60s)" is problematic because it needs to be updated whenever
PCIE_RESET_READY_POLL_MS changes.
pci_dev_wait() doesn't use PCIE_RESET_READY_POLL_MS.
pci_bridge_wait_for_secondary_bus() does.
How about a one line change à la:
> - * but reports indicate that DPC completes within 4 seconds.
> + * so use the same timeout as pci_bridge_wait_for_secondary_bus().
Thanks,
Lukas