diff mbox series

[v1,2/2] PCI: dwc: Skip waiting for link up on probe

Message ID 20230224195749.818282-3-sdalvi@google.com (mailing list archive)
State Changes Requested
Headers show
Series Skip waiting for link up during probe | expand

Commit Message

Sajid Dalvi Feb. 24, 2023, 7:57 p.m. UTC
When the Root Complex is probed, the default behavior is to spin in a loop
waiting for the link to come up. In some systems the link is not brought up
during probe, but later in the context of an end-point turning on.

Call trace:
dw_pcie_wait_for_link << spins in a loop for 1 second
dw_pcie_host_init

Adding the snps,skip-wait-link-up property in the pcie device tree node
will skip this loop and save 1 second per interface on pcie probe for
systems that do not need to bring up the link this early in the boot
sequence.

Signed-off-by: Sajid Dalvi <sdalvi@google.com>
Signed-off-by: Andrew Chant <achant@google.com>
---
 drivers/pci/controller/dwc/pcie-designware-host.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/drivers/pci/controller/dwc/pcie-designware-host.c b/drivers/pci/controller/dwc/pcie-designware-host.c
index 3ab6ae3712c4..f5cba44ebf39 100644
--- a/drivers/pci/controller/dwc/pcie-designware-host.c
+++ b/drivers/pci/controller/dwc/pcie-designware-host.c
@@ -477,8 +477,9 @@  int dw_pcie_host_init(struct dw_pcie_rp *pp)
 			goto err_free_msi;
 	}
 
-	/* Ignore errors, the link may come up later */
-	dw_pcie_wait_for_link(pci);
+	if (!of_property_read_bool(np, "snps,skip-wait-link-up"))
+		/* Ignore errors, the link may come up later */
+		dw_pcie_wait_for_link(pci);
 
 	bridge->sysdata = pp;