Skip to content

Commit 15b6b24

Browse files
floatiousMani-Sadhasivam
authored andcommitted
PCI: qcom: Wait PCIE_RESET_CONFIG_WAIT_MS after link-up IRQ
Per PCIe r6.0, sec 6.6.1, software must generally wait a minimum of 100ms (PCIE_RESET_CONFIG_WAIT_MS) after Link training completes before sending a Configuration Request. Prior to 36971d6 ("PCI: qcom: Don't wait for link if we can detect Link Up"), qcom used dw_pcie_wait_for_link(), which waited between 0 and 90ms after the link came up before we enumerate the bus, and this was apparently enough for most devices. After 36971d6, qcom_pcie_global_irq_thread() started enumeration immediately when handling the link-up IRQ, and devices (e.g., Laszlo Fiat's PLEXTOR PX-256M8PeGN NVMe SSD) may not be ready to handle config requests yet. Delay PCIE_RESET_CONFIG_WAIT_MS after the link-up IRQ before starting enumeration. Fixes: 82a8238 ("PCI: qcom: Add Qualcomm PCIe controller driver") 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 c7eb9c5 commit 15b6b24

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1564,6 +1564,7 @@ static irqreturn_t qcom_pcie_global_irq_thread(int irq, void *data)
15641564
writel_relaxed(status, pcie->parf + PARF_INT_ALL_CLEAR);
15651565

15661566
if (FIELD_GET(PARF_INT_ALL_LINK_UP, status)) {
1567+
msleep(PCIE_RESET_CONFIG_WAIT_MS);
15671568
dev_dbg(dev, "Received Link up event. Starting enumeration!\n");
15681569
/* Rescan the bus to enumerate endpoint devices */
15691570
pci_lock_rescan_remove();

0 commit comments

Comments
 (0)