linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] PCI: mediatek: increase link training timeout
@ 2023-03-26 12:12 Oskari Lemmela
  2023-05-01 20:36 ` Bjorn Helgaas
  0 siblings, 1 reply; 3+ messages in thread
From: Oskari Lemmela @ 2023-03-26 12:12 UTC (permalink / raw)
  To: Matthias Brugger
  Cc: Ryder Lee, Jianjun Wang, Lorenzo Pieralisi,
	Krzysztof Wilczyński, Rob Herring, Bjorn Helgaas, linux-pci,
	Oskari Lemmela

Some PCI devices fail to complete link training in 100ms.
Increase link training timeout by 20ms to 120ms.

Signed-off-by: Oskari Lemmela <oskari@lemmela.net>
---
 drivers/pci/controller/pcie-mediatek.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/pci/controller/pcie-mediatek.c b/drivers/pci/controller/pcie-mediatek.c
index ae5ad05ddc1d..67b8cf0dc9f7 100644
--- a/drivers/pci/controller/pcie-mediatek.c
+++ b/drivers/pci/controller/pcie-mediatek.c
@@ -720,10 +720,10 @@ static int mtk_pcie_startup_port_v2(struct mtk_pcie_port *port)
 	if (soc->need_fix_device_id)
 		writew(soc->device_id, port->base + PCIE_CONF_DEVICE_ID);
 
-	/* 100ms timeout value should be enough for Gen1/2 training */
+	/* 120ms timeout value should be enough for Gen1/2 training */
 	err = readl_poll_timeout(port->base + PCIE_LINK_STATUS_V2, val,
 				 !!(val & PCIE_PORT_LINKUP_V2), 20,
-				 100 * USEC_PER_MSEC);
+				 120 * USEC_PER_MSEC);
 	if (err)
 		return -ETIMEDOUT;
 
@@ -785,10 +785,10 @@ static int mtk_pcie_startup_port(struct mtk_pcie_port *port)
 	val &= ~PCIE_PORT_PERST(port->slot);
 	writel(val, pcie->base + PCIE_SYS_CFG);
 
-	/* 100ms timeout value should be enough for Gen1/2 training */
+	/* 120ms timeout value should be enough for Gen1/2 training */
 	err = readl_poll_timeout(port->base + PCIE_LINK_STATUS, val,
 				 !!(val & PCIE_PORT_LINKUP), 20,
-				 100 * USEC_PER_MSEC);
+				 120 * USEC_PER_MSEC);
 	if (err)
 		return -ETIMEDOUT;
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-05-02 17:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-26 12:12 [PATCH] PCI: mediatek: increase link training timeout Oskari Lemmela
2023-05-01 20:36 ` Bjorn Helgaas
2023-05-02 17:43   ` Oskari Lemmelä

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).