]> git.ipfire.org Git - thirdparty/linux.git/commit
PCI: Add pci_host_common_link_train_delay() helper
authorHans Zhang <18255117159@163.com>
Mon, 18 May 2026 00:42:40 +0000 (08:42 +0800)
committerManivannan Sadhasivam <mani@kernel.org>
Tue, 9 Jun 2026 15:22:09 +0000 (20:52 +0530)
commit29fbf582e75015c031e7965fdd4084af123b9ca2
tree9a26dcba917d11d473938717ba380ca06ab42148
parent254f49634ee16a731174d2ae34bc50bd5f45e731
PCI: Add pci_host_common_link_train_delay() helper

PCIe r6.0, sec 6.6.1 (Conventional Reset) requires that for a Downstream
Port supporting Link speeds greater than 5.0 GT/s, software must wait a
minimum of 100 ms after Link training completes before sending any
Configuration Request.

Introduce a static inline helper pci_host_common_link_train_delay() that
checks the given max_link_speed (2 = 5.0 GT/s, 3 = 8.0 GT/s, etc.) and
calls msleep(100) only when the speed is greater than 5.0 GT/s.

This allows multiple host controller drivers to share the same mandatory
delay without duplicating the logic.

Signed-off-by: Hans Zhang <18255117159@163.com>
Signed-off-by: Manivannan Sadhasivam <mani@kernel.org>
Link: https://patch.msgid.link/20260518004246.1384532-2-18255117159@163.com
drivers/pci/controller/pci-host-common.h