[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230227201340.2087605-1-sdalvi@google.com>
Date: Mon, 27 Feb 2023 14:13:40 -0600
From: Sajid Dalvi <sdalvi@...gle.com>
To: Jingoo Han <jingoohan1@...il.com>,
Gustavo Pimentel <gustavo.pimentel@...opsys.com>,
Lorenzo Pieralisi <lpieralisi@...nel.org>,
"Krzysztof WilczyĆski" <kw@...ux.com>,
Rob Herring <robh@...nel.org>,
Bjorn Helgaas <bhelgaas@...gle.com>
Cc: Sajid Dalvi <sdalvi@...gle.com>, kernel-team@...roid.com,
linux-pci@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH v2] PCI: dwc: Wait for link up only if link is started
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 1
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.
Call trace when start_link() is not defined:
dw_pcie_wait_for_link << spins in a loop for 1 second
dw_pcie_host_init
Signed-off-by: Sajid Dalvi <sdalvi@...gle.com>
---
drivers/pci/controller/dwc/pcie-designware-host.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/pci/controller/dwc/pcie-designware-host.c b/drivers/pci/controller/dwc/pcie-designware-host.c
index 9952057c8819..9709f69f173e 100644
--- a/drivers/pci/controller/dwc/pcie-designware-host.c
+++ b/drivers/pci/controller/dwc/pcie-designware-host.c
@@ -489,10 +489,10 @@ int dw_pcie_host_init(struct dw_pcie_rp *pp)
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);
+ /* Ignore errors, the link may come up later */
+ dw_pcie_wait_for_link(pci);
+ }
bridge->sysdata = pp;
--
2.39.2.722.g9855ee24e9-goog
Powered by blists - more mailing lists