Skip to content

Commit 8d3bf19

Browse files
Krishna chaitanya chundrubjorn-helgaas
authored andcommitted
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/[email protected] Signed-off-by: Krishna chaitanya chundru <[email protected]> Signed-off-by: Krzysztof Wilczyński <[email protected]> [bhelgaas: wrap comment, update commit log] Signed-off-by: Bjorn Helgaas <[email protected]> Reviewed-by: Manivannan Sadhasivam <[email protected]> Reviewed-by: Niklas Cassel <[email protected]>
1 parent 574913f commit 8d3bf19

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

drivers/pci/controller/dwc/pcie-designware-host.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -530,8 +530,14 @@ int dw_pcie_host_init(struct dw_pcie_rp *pp)
530530
goto err_remove_edma;
531531
}
532532

533-
/* Ignore errors, the link may come up later */
534-
dw_pcie_wait_for_link(pci);
533+
/*
534+
* Note: Skip the link up delay only when a Link Up IRQ is present.
535+
* If there is no Link Up IRQ, we should not bypass the delay
536+
* because that would require users to manually rescan for devices.
537+
*/
538+
if (!pp->use_linkup_irq)
539+
/* Ignore errors, the link may come up later */
540+
dw_pcie_wait_for_link(pci);
535541

536542
bridge->sysdata = pp;
537543

drivers/pci/controller/dwc/pcie-designware.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,7 @@ struct dw_pcie_rp {
379379
bool use_atu_msg;
380380
int msg_atu_index;
381381
struct resource *msg_res;
382+
bool use_linkup_irq;
382383
};
383384

384385
struct dw_pcie_ep_ops {

0 commit comments

Comments
 (0)