]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
PCI: mediatek-gen3: Add 100 ms delay after link up
authorHans Zhang <18255117159@163.com>
Mon, 18 May 2026 00:42:45 +0000 (08:42 +0800)
committerBjorn Helgaas <bhelgaas@google.com>
Tue, 23 Jun 2026 19:36:33 +0000 (14:36 -0500)
The MediaTek Gen3 PCIe host driver lacks the required 100 ms delay after
link training completes for speeds > 5.0 GT/s, as specified in PCIe r6.0
sec 6.6.1.

The driver already stores max_link_speed (from the device tree). After
mtk_pcie_startup_port() successfully brings up the link, call
pci_host_common_link_train_delay() to comply with the specification.

Signed-off-by: Hans Zhang <18255117159@163.com>
Signed-off-by: Manivannan Sadhasivam <mani@kernel.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Link: https://patch.msgid.link/20260518004246.1384532-7-18255117159@163.com
drivers/pci/controller/pcie-mediatek-gen3.c

index b0accd82858921fd5ffeeab1d876e7f13e1d0208..5abddec4e9bec8cb65ff2068816a0ec9ca1fcc79 100644 (file)
@@ -30,6 +30,7 @@
 #include <linux/regmap.h>
 #include <linux/reset.h>
 
+#include "pci-host-common.h"
 #include "../pci.h"
 
 #define PCIE_BASE_CFG_REG              0x14
@@ -570,6 +571,8 @@ static int mtk_pcie_startup_port(struct mtk_gen3_pcie *pcie)
                goto err_power_down_device;
        }
 
+       pci_host_common_link_train_delay(pcie->max_link_speed);
+
        return 0;
 
 err_power_down_device: