Skip to content

Commit ed5c554

Browse files
marcanjannau
authored andcommitted
PCI: apple: Make link up timeout configurable, default to 500ms
We're seeing link up timeouts and it looks like devices are just too slow. Let's just increase this. Signed-off-by: Hector Martin <[email protected]>
1 parent 663754e commit ed5c554

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

drivers/pci/controller/pcie-apple.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@
3131
#include <linux/of_irq.h>
3232
#include <linux/pci-ecam.h>
3333

34+
static int link_up_timeout = 500;
35+
module_param(link_up_timeout, int, 0644);
36+
MODULE_PARM_DESC(link_up_timeout, "PCIe link training timeout in milliseconds");
37+
3438
#define CORE_RC_PHYIF_CTL 0x00024
3539
#define CORE_RC_PHYIF_CTL_RUN BIT(0)
3640
#define CORE_RC_PHYIF_STAT 0x00028
@@ -738,7 +742,7 @@ static int apple_pcie_setup_port(struct apple_pcie *pcie,
738742
/* start link training */
739743
writel_relaxed(PORT_LTSSMCTL_START, port->base + PORT_LTSSMCTL);
740744

741-
if (!wait_for_completion_timeout(&pcie->event, HZ / 10))
745+
if (!wait_for_completion_timeout(&pcie->event, link_up_timeout * HZ / 1000))
742746
dev_warn(pcie->dev, "%pOF link didn't come up\n", np);
743747

744748
if (pcie->hw->port_refclk)

0 commit comments

Comments
 (0)