Skip to content

Commit 27ae6dd

Browse files
committed
PCI: dpc: Increase pciehp waiting time for DPC recovery
zhaoxin inclusion category: feature -------------------- Commit a97396c ("PCI: pciehp: Ignore Link Down/Up caused by DPC") amended PCIe hotplug to not bring down the slot upon Data Link Layer State Changed events caused by Downstream Port Containment. However, PCIe hotplug (pciehp) waits up to 4 seconds before assuming that DPC recovery has failed and disabling the slot. This timeout period is insufficient for some PCIe devices. For example, the E810 dual-port network card driver needs to take over 10 seconds to execute its err_detected() callback. Since this exceeds the maximum wait time allowed for DPC recovery by the hotplug IRQ threads, a race condition occurs between the hotplug thread and the dpc_handler() thread. Signed-off-by: leoliu-oc <leoliu-oc@zhaoxin.com>
1 parent 88464bd commit 27ae6dd

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/pci/pcie/dpc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,10 @@ bool pci_dpc_recovered(struct pci_dev *pdev)
115115
/*
116116
* Need a timeout in case DPC never completes due to failure of
117117
* dpc_wait_rp_inactive(). The spec doesn't mandate a time limit,
118-
* but reports indicate that DPC completes within 4 seconds.
118+
* but reports indicate that DPC completes within 16 seconds.
119119
*/
120120
wait_event_timeout(dpc_completed_waitqueue, dpc_completed(pdev),
121-
msecs_to_jiffies(4000));
121+
msecs_to_jiffies(16000));
122122

123123
return test_and_clear_bit(PCI_DPC_RECOVERED, &pdev->priv_flags);
124124
}

0 commit comments

Comments
 (0)