public inbox for linux-pci@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v7 0/2] PCI: of: Remove max-link-speed generation validation
@ 2026-03-08 14:26 Hans Zhang
  2026-03-08 14:26 ` [PATCH v7 1/2] " Hans Zhang
  2026-03-08 14:26 ` [PATCH v7 2/2] PCI: dwc: Validate max-link-speed property Hans Zhang
  0 siblings, 2 replies; 13+ messages in thread
From: Hans Zhang @ 2026-03-08 14:26 UTC (permalink / raw)
  To: lpieralisi, jingoohan1, mani, kwilczynski, bhelgaas, helgaas
  Cc: robh, ilpo.jarvinen, linux-pci, linux-kernel, Hans Zhang

This series removes the hardcoded max-link-speed validation from
of_pci_get_max_link_speed() to avoid updating the kernel for every new
PCIe generation. As pointed out by Bjorn Helgaas, the removal must be
accompanied by proper validation in callers to ensure robustness.
Therefore, this series also adds validation in the DWC controller driver,
which is a primary user of this function.

Patch 1 simplifies of_pci_get_max_link_speed() by returning the raw
property value (including error codes) without imposing an artificial
upper bound. Patch 2 introduces dw_pcie_get_link_speed() in the DWC core
to validate the retrieved speed against the known pcie_link_speed array,
falling back to Gen1 (safe default) if the value is missing or invalid.

---
Changes for v7:
- Add validation in dw_pcie_get_link_speed() (Bjorn)
- Modify it so that two patches constitute one series.

Changes for v6:
https://patchwork.kernel.org/project/linux-pci/patch/20251218132036.308094-1-18255117159@163.com/

- It'd be good to return the actual errno as of_property_read_u32() can return
  -EINVAL, -ENODATA and -EOVERFLOW. (Mani)

Changes for v5:
https://patchwork.kernel.org/project/linux-pci/patch/20251218125909.305300-1-18255117159@163.com/

- Delete the check for speed. (Mani)

Changes for v4:
https://patchwork.kernel.org/project/linux-pci/patch/20251105134701.182795-1-18255117159@163.com/

- Add pcie_max_supported_link_speed.(Ilpo)

Changes for v3:
https://patchwork.kernel.org/project/linux-pci/patch/20251101164132.14145-1-18255117159@163.com/

- Modify the commit message.
- Add Reviewed-by tag.

Changes for v2:
https://patchwork.kernel.org/project/linux-pci/cover/20250529021026.475861-1-18255117159@163.com/
- The following files have been deleted:
  Documentation/devicetree/bindings/pci/pci.txt

  Update to this file again:
  dtschema/schemas/pci/pci-bus-common.yaml
---

Hans Zhang (2):
  PCI: of: Remove max-link-speed generation validation
  PCI: dwc: Validate max-link-speed property

 drivers/pci/controller/dwc/pcie-designware.c | 29 +++++++++++++++++++-
 drivers/pci/of.c                             |  7 +++--
 2 files changed, 32 insertions(+), 4 deletions(-)


base-commit: c23719abc3308df7ed3ad35650ad211fb2d2003d
-- 
2.34.1


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

end of thread, other threads:[~2026-03-12 16:19 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-08 14:26 [PATCH v7 0/2] PCI: of: Remove max-link-speed generation validation Hans Zhang
2026-03-08 14:26 ` [PATCH v7 1/2] " Hans Zhang
2026-03-09  0:38   ` Shawn Lin
2026-03-09 14:21     ` Hans Zhang
2026-03-09 11:47   ` Manivannan Sadhasivam
2026-03-09 14:47     ` Hans Zhang
2026-03-10 22:37   ` Bjorn Helgaas
2026-03-12 16:18     ` Hans Zhang
2026-03-08 14:26 ` [PATCH v7 2/2] PCI: dwc: Validate max-link-speed property Hans Zhang
2026-03-08 18:10   ` kernel test robot
2026-03-09 14:45     ` Hans Zhang
2026-03-09 11:11   ` kernel test robot
2026-03-09 15:44   ` kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox