Skip to content

Commit 80dc18a

Browse files
floatiousMani-Sadhasivam
authored andcommitted
PCI: dwc: Ensure that dw_pcie_wait_for_link() waits 100 ms after link up
As per PCIe r6.0, sec 6.6.1, a Downstream Port that supports Link speeds greater than 5.0 GT/s, software must wait a minimum of 100 ms after Link training completes before sending a Configuration Request. Add this delay in dw_pcie_wait_for_link(), after the link is reported as up. The delay will only be performed in the success case where the link came up. DWC glue drivers that have a link up IRQ (drivers that set use_linkup_irq = true) do not call dw_pcie_wait_for_link(), instead they perform this delay in their threaded link up IRQ handler. Signed-off-by: Niklas Cassel <[email protected]> Signed-off-by: Manivannan Sadhasivam <[email protected]> Reviewed-by: Damien Le Moal <[email protected]> Reviewed-by: Wilfred Mallawa <[email protected]> Link: https://patch.msgid.link/[email protected]
1 parent 15b6b24 commit 80dc18a

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

drivers/pci/controller/dwc/pcie-designware.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -714,6 +714,14 @@ int dw_pcie_wait_for_link(struct dw_pcie *pci)
714714
return -ETIMEDOUT;
715715
}
716716

717+
/*
718+
* As per PCIe r6.0, sec 6.6.1, a Downstream Port that supports Link
719+
* speeds greater than 5.0 GT/s, software must wait a minimum of 100 ms
720+
* after Link training completes before sending a Configuration Request.
721+
*/
722+
if (pci->max_link_speed > 2)
723+
msleep(PCIE_RESET_CONFIG_WAIT_MS);
724+
717725
offset = dw_pcie_find_capability(pci, PCI_CAP_ID_EXP);
718726
val = dw_pcie_readw_dbi(pci, offset + PCI_EXP_LNKSTA);
719727

0 commit comments

Comments
 (0)