Skip to content

Commit 14b8b73

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 <marcan@marcan.st>
1 parent d3575a3 commit 14b8b73

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

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
@@ -739,7 +743,7 @@ static int apple_pcie_setup_port(struct apple_pcie *pcie,
739743
/* start link training */
740744
writel_relaxed(PORT_LTSSMCTL_START, port->base + PORT_LTSSMCTL);
741745

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

745749
if (pcie->hw->port_refclk)

0 commit comments

Comments
 (0)