Skip to content

Commit 8e7e689

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 d2bb1d2 commit 8e7e689

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
@@ -30,6 +30,10 @@
3030
#include <linux/of_irq.h>
3131
#include <linux/pci-ecam.h>
3232

33+
static int link_up_timeout = 500;
34+
module_param(link_up_timeout, int, 0644);
35+
MODULE_PARM_DESC(link_up_timeout, "PCIe link training timeout in milliseconds");
36+
3337
/* T8103 (original M1) and related SoCs */
3438
#define CORE_RC_PHYIF_CTL 0x00024
3539
#define CORE_RC_PHYIF_CTL_RUN BIT(0)
@@ -726,7 +730,7 @@ static int apple_pcie_setup_port(struct apple_pcie *pcie,
726730
/* start link training */
727731
writel_relaxed(PORT_LTSSMCTL_START, port->base + PORT_LTSSMCTL);
728732

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

732736
return 0;

0 commit comments

Comments
 (0)