Linux PCI subsystem development
 help / color / mirror / Atom feed
* [PATCH v3 0/5] PCI: Encapsulate pcie_link_speed array access
@ 2026-11-12  2:24 Hans Zhang
  2026-11-12  2:24 ` [PATCH v3 1/5] PCI: Use pcie_get_link_speed() in pci.c Hans Zhang
                   ` (4 more replies)
  0 siblings, 5 replies; 12+ messages in thread
From: Hans Zhang @ 2026-11-12  2:24 UTC (permalink / raw)
  To: bhelgaas, mani, lpieralisi, kwilczynski, thierry.reding,
	ryder.lee, jonathanh
  Cc: robh, linux-pci, linux-kernel, linux-mediatek, linux-tegra,
	Hans Zhang

Hi,

This series finishes encapsulating the pcie_link_speed[] array by
converting the remaining direct users to pcie_get_link_speed() and
making the array private to probe.c.

The pcie_get_link_speed() helper was introduced and accepted in the
v10 "PCI: of: Remove max-link-speed generation validation" series, but
a few users that were added later still index pcie_link_speed[]
directly.

Changes since v2:
- In pci.c, extract the PCI_EXP_LNKSTA_CLS field into a local
  lnksta_cls variable in pcie_link_bandwidth_mbps() and
  pcie_bandwidth_available() so the pcie_get_link_speed() calls stay
  readable.  This addresses the readability concern raised by Ilpo.
- No changes to the remaining patches.

Changes since v1:
- Rebase onto v7.4-rc1.
- Use pcie_get_link_speed(), which is already exported and
  bounds-checked, instead of introducing a new to_pcie_link_speed()
  helper.
- Split the pci.c change from the other core conversions, mirroring the
  split between v1 patches 1 and 2.
- Convert probe.c's max_bus_speed lookup, which v1 missed.
- Convert the Tegra264 and MediaTek controller drivers, which were
  added after the v10 series and would otherwise fail to build once the
  array is no longer exported.
- Split the two controller conversions into separate patches so each
  driver can be reviewed independently.
- Make pcie_link_speed[] static instead of only removing its extern
  declaration and export.

v2 series:
https://patchwork.kernel.org/project/linux-pci/patch/20261108094034.679945-1-18255117159@163.com/

v1 series:
https://patchwork.kernel.org/project/linux-pci/patch/20260315160057.127639-1-18255117159@163.com/

Hans Zhang (5):
  PCI: Use pcie_get_link_speed() in pci.c
  PCI: Convert remaining core pcie_link_speed[] users
  PCI: tegra264: Use pcie_get_link_speed()
  PCI: mediatek: Use pcie_get_link_speed()
  PCI: Make pcie_link_speed[] private to probe.c

 drivers/pci/controller/pcie-mediatek.c |  2 +-
 drivers/pci/controller/pcie-tegra264.c |  6 +++---
 drivers/pci/pci-sysfs.c                |  2 +-
 drivers/pci/pci.c                      | 15 ++++++---------
 drivers/pci/pci.h                      |  3 +--
 drivers/pci/probe.c                    |  6 ++----
 6 files changed, 14 insertions(+), 20 deletions(-)


base-commit: 6628e7d4c6b25c8d18f1345e3a20d21829aae7e4
-- 
2.43.0


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

end of thread, other threads:[~2026-11-12 10:25 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-12  2:24 [PATCH v3 0/5] PCI: Encapsulate pcie_link_speed array access Hans Zhang
2026-11-12  2:24 ` [PATCH v3 1/5] PCI: Use pcie_get_link_speed() in pci.c Hans Zhang
2026-11-12  2:28   ` sashiko-bot
2026-11-12 10:25   ` Ilpo Järvinen
2026-11-12  2:24 ` [PATCH v3 2/5] PCI: Convert remaining core pcie_link_speed[] users Hans Zhang
2026-11-12  2:30   ` sashiko-bot
2026-11-12  2:24 ` [PATCH v3 3/5] PCI: tegra264: Use pcie_get_link_speed() Hans Zhang
2026-11-12  2:29   ` sashiko-bot
2026-11-12  2:24 ` [PATCH v3 4/5] PCI: mediatek: " Hans Zhang
2026-11-12  2:30   ` sashiko-bot
2026-11-12  2:24 ` [PATCH v3 5/5] PCI: Make pcie_link_speed[] private to probe.c Hans Zhang
2026-11-12  2:27   ` sashiko-bot

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