Skip to content

Commit 2b0d1a6

Browse files
Hans Zhangbjorn-helgaas
authored andcommitted
PCI: rzg3s-host: Use common pci_host_common_link_train_delay() helper
Replace the unconditional msleep(100) with the common helper pci_host_common_link_train_delay(). The helper only waits when max_link_speed > 2, as required by PCIe r6.0 sec 6.6.1. This avoids unnecessary delay for Gen1/Gen2 links while retaining the mandatory 100 ms for higher speeds. 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-8-18255117159@163.com
1 parent d24e3fa commit 2b0d1a6

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

drivers/pci/controller/pcie-rzg3s-host.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
#include <linux/slab.h>
3636
#include <linux/units.h>
3737

38+
#include "pci-host-common.h"
3839
#include "../pci.h"
3940

4041
/* AXI registers */
@@ -1663,7 +1664,7 @@ rzg3s_pcie_host_setup(struct rzg3s_pcie_host *host,
16631664
if (ret)
16641665
dev_info(dev, "Failed to set max link speed\n");
16651666

1666-
msleep(PCIE_RESET_CONFIG_WAIT_MS);
1667+
pci_host_common_link_train_delay(host->max_link_speed);
16671668

16681669
return 0;
16691670

0 commit comments

Comments
 (0)