UPSTREAM: PCI: dwc: Don't wait for link up if driver can detect Link Up event

If the driver can detect the Link Up event and enumerate downstream devices
at that time, we need not wait here.

Skip waiting for link to come up if the driver supports 'use_linkup_irq'.

Link: https://lore.kernel.org/r/20241123-remove_wait2-v5-1-b5f9e6b794c2@quicinc.com
Signed-off-by: Krishna chaitanya chundru <quic_krichai@quicinc.com>
Signed-off-by: Krzysztof Wilczyński <kwilczynski@kernel.org>
[bhelgaas: wrap comment, update commit log]
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Reviewed-by: Niklas Cassel <cassel@kernel.org>

Bug: 374242499
Change-Id: I0ecc36d8fedf45e7ceead3bbef0b038243547762
(cherry picked from commit 8d3bf19f1b585a3cc0027f508b64c33484db8d0d)
Signed-off-by: Ajay Agarwal <ajayagarwal@google.com>
This commit is contained in:
Krishna chaitanya chundru
2024-11-23 00:39:59 +05:30
committed by Carlos Llamas
parent c76e7960f1
commit 5b139068a7
2 changed files with 9 additions and 2 deletions
@@ -531,8 +531,14 @@ int dw_pcie_host_init(struct dw_pcie_rp *pp)
goto err_remove_edma;
}
/* Ignore errors, the link may come up later */
dw_pcie_wait_for_link(pci);
/*
* Note: Skip the link up delay only when a Link Up IRQ is present.
* If there is no Link Up IRQ, we should not bypass the delay
* because that would require users to manually rescan for devices.
*/
if (!pp->use_linkup_irq)
/* Ignore errors, the link may come up later */
dw_pcie_wait_for_link(pci);
bridge->sysdata = pp;
@@ -379,6 +379,7 @@ struct dw_pcie_rp {
bool use_atu_msg;
int msg_atu_index;
struct resource *msg_res;
bool use_linkup_irq;
};
struct dw_pcie_ep_ops {