]> git.ipfire.org Git - thirdparty/linux.git/commit
PCI: controller: Validate max-link-speed
authorHans Zhang <18255117159@163.com>
Fri, 13 Mar 2026 16:55:21 +0000 (00:55 +0800)
committerManivannan Sadhasivam <mani@kernel.org>
Thu, 26 Mar 2026 18:31:31 +0000 (00:01 +0530)
commit03f920936977b5133a0e57a7c9fdeb4e584eeb06
tree4dd68d80b5d74c2a76492e8544d0d80e910a9b88
parent126d04398cd4e29743828c38c21f39f46fc2e004
PCI: controller: Validate max-link-speed

Add validation for the "max-link-speed" DT property in three more
drivers, using the pcie_get_link_speed() helper.

- brcmstb: If the value is missing or invalid, fall back to no
  limitation (pcie->gen = 0).  Fix the previous incorrect logic.
- mediatek-gen3: If the value is missing or invalid, use the maximum
  speed supported by the controller.
- rzg3s-host: If the value is missing or invalid, fall back to Gen2.

This ensures that all users of of_pci_get_max_link_speed() are ready
for the removal of the central range check.

Signed-off-by: Hans Zhang <18255117159@163.com>
Signed-off-by: Manivannan Sadhasivam <mani@kernel.org>
Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
Link: https://patch.msgid.link/20260313165522.123518-5-18255117159@163.com
drivers/pci/controller/pcie-brcmstb.c
drivers/pci/controller/pcie-mediatek-gen3.c
drivers/pci/controller/pcie-rzg3s-host.c