Skip to content

Commit 035d7af

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 1a6b96f commit 035d7af

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
@@ -33,6 +33,10 @@
3333

3434
#include "pci-host-common.h"
3535

36+
static int link_up_timeout = 500;
37+
module_param(link_up_timeout, int, 0644);
38+
MODULE_PARM_DESC(link_up_timeout, "PCIe link training timeout in milliseconds");
39+
3640
/* T8103 (original M1) and related SoCs */
3741
#define CORE_RC_PHYIF_CTL 0x00024
3842
#define CORE_RC_PHYIF_CTL_RUN BIT(0)
@@ -704,7 +708,7 @@ static int apple_pcie_setup_port(struct apple_pcie *pcie,
704708
/* start link training */
705709
writel_relaxed(PORT_LTSSMCTL_START, port->base + PORT_LTSSMCTL);
706710

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

710714
return 0;

0 commit comments

Comments
 (0)