In dw_pcie_host_init(), regardless of whether the link has been started or not, the code waits for the link to come up. Even in cases where .start_link() is not defined the code ends up spinning in a loop for one second. Since in some systems dw_pcie_host_init() gets called during probe, this one second loop for each PCIe interface instance ends up extending the boot time. Signed-off-by: Ajay Agarwal <ajayagarwal@xxxxxxxxxx> --- This is actually patch v6 for [1] which I have made a part of the patch series. v4 [2] was applied, but then reverted [3]. The reason being v4 added a regression on some products which expect the link to not come up as a part of the probe. Since v4 returned error from dw_pcie_wait_for_link check, the probe function of these products started to fail. [1] https://lore.kernel.org/all/20240112093006.2832105-1-ajayagarwal@xxxxxxxxxx/ [2] https://lore.kernel.org/all/20230412093425.3659088-1-ajayagarwal@xxxxxxxxxx/ [3] https://lore.kernel.org/all/20230706082610.26584-1-johan+linaro@xxxxxxxxxx/ drivers/pci/controller/dwc/pcie-designware-host.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/pci/controller/dwc/pcie-designware-host.c b/drivers/pci/controller/dwc/pcie-designware-host.c index 7991f0e179b2..e53132663d1d 100644 --- a/drivers/pci/controller/dwc/pcie-designware-host.c +++ b/drivers/pci/controller/dwc/pcie-designware-host.c @@ -487,14 +487,18 @@ int dw_pcie_host_init(struct dw_pcie_rp *pp) if (ret) goto err_remove_edma; - if (!dw_pcie_link_up(pci)) { + if (dw_pcie_link_up(pci)) { + dw_pcie_print_link_status(pci); + } else { ret = dw_pcie_start_link(pci); if (ret) goto err_remove_edma; - } - /* Ignore errors, the link may come up later */ - dw_pcie_wait_for_link(pci); + if (pci->ops && pci->ops->start_link) { + /* Ignore errors, the link may come up later */ + dw_pcie_wait_for_link(pci); + } + } bridge->sysdata = pp; -- 2.43.0.429.g432eaa2c6b-goog