Skip to content

Commit 3cf2d72

Browse files
marcanjannau
authored andcommitted
PCI: apple: Log the time it takes for links to come up
Signed-off-by: Hector Martin <[email protected]>
1 parent 34e68eb commit 3cf2d72

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

drivers/pci/controller/pcie-apple.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -738,11 +738,18 @@ static int apple_pcie_setup_port(struct apple_pcie *pcie,
738738

739739
link_stat = readl_relaxed(port->base + PORT_LINKSTS);
740740
if (!(link_stat & PORT_LINKSTS_UP)) {
741+
unsigned long timeout, left;
741742
/* start link training */
742743
writel_relaxed(PORT_LTSSMCTL_START, port->base + PORT_LTSSMCTL);
743744

744-
if (!wait_for_completion_timeout(&pcie->event, link_up_timeout * HZ / 1000))
745+
timeout = link_up_timeout * HZ / 1000;
746+
left = wait_for_completion_timeout(&pcie->event, timeout);
747+
if (!left)
745748
dev_warn(pcie->dev, "%pOF link didn't come up\n", np);
749+
else
750+
dev_info(pcie->dev, "%pOF link up after %ldms\n", np,
751+
(timeout - left) * 1000 / HZ);
752+
746753
}
747754

748755
if (pcie->hw->port_refclk)

0 commit comments

Comments
 (0)