Skip to content

Commit ed572d2

Browse files
marcanjannau
authored andcommitted
PCI: apple: Log the time it takes for links to come up
Signed-off-by: Hector Martin <marcan@marcan.st>
1 parent 975d812 commit ed572d2

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

drivers/pci/controller/pcie-apple.c

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

705705
link_stat = readl_relaxed(port->base + PORT_LINKSTS);
706706
if (!(link_stat & PORT_LINKSTS_UP)) {
707+
unsigned long timeout, left;
707708
/* start link training */
708709
writel_relaxed(PORT_LTSSMCTL_START, port->base + PORT_LTSSMCTL);
709710

710-
if (!wait_for_completion_timeout(&pcie->event, link_up_timeout * HZ / 1000))
711+
timeout = link_up_timeout * HZ / 1000;
712+
left = wait_for_completion_timeout(&pcie->event, timeout);
713+
if (!left)
711714
dev_warn(pcie->dev, "%pOF link didn't come up\n", np);
715+
else
716+
dev_info(pcie->dev, "%pOF link up after %ldms\n", np,
717+
(timeout - left) * 1000 / HZ);
718+
712719
}
713720

714721
return 0;

0 commit comments

Comments
 (0)