1
1
openwrt/target/linux/realtek
Jonas Jelonek 15593de376
realtek: pcs: derive SerDes link count from DT at probe time
Previously, sds->num_of_links was incremented from rtpcs_create() as
each DSA port bound its phylink_pcs. The count therefore relied on a
temporal contract (DSA must finish enumerating before pcs_config runs)
and on rtpcs_create() being the single chokepoint for all consumers.

Replace this with a probe-time scan of pcs-handle references in the
live OF tree: for every available consumer node carrying a pcs-handle
property pointing at one of our SerDes subnodes, bump that SerDes'
num_of_links. After the scan, the count is final regardless of when
or whether DSA later calls in.

To allow of_parse_phandle_with_args() to walk the property correctly,
add #pcs-cells = <0> to every serdes@N node in the 838x/839x/930x/931x
.dtsi files. A future cell-bearing form remains possible without
touching the scan.

Over-references (DT pointing more consumers at one SerDes than the
hardware can carry) are clamped at RTPCS_MAX_LINKS_PER_SDS and warned
about, but do not fail probe — the correctly-wired ports on that
SerDes still come up, and only the surplus reference is dropped.

The bounds check and the bare ++ in rtpcs_create() become redundant
under the scan-driven count and are removed.

This decouples num_of_links from DSA call ordering and is a prereq
for migrating to fwnode_pcs providers, where rtpcs_create() goes away
as the centralised counter.

Link: https://github.com/openwrt/openwrt/pull/23484
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-05-23 11:02:15 +02:00
..
base-files realtek: add support for Zyxel XGS1930-28HP 2026-05-17 13:12:18 +02:00
dts realtek: pcs: derive SerDes link count from DT at probe time 2026-05-23 11:02:15 +02:00
files-6.18 realtek: pcs: derive SerDes link count from DT at probe time 2026-05-23 11:02:15 +02:00
image generic: net: phy: realtek: add 5G and 10G PHY support 2026-05-21 17:04:55 +01:00
patches-6.18 generic: 6.18: drop downstream RTL8261N driver 2026-05-21 17:04:55 +01:00
profiles target: use SPDX license identifiers on Makefiles 2021-02-10 15:47:18 +01:00
rtl838x realtek: drop support for 6.12 2026-04-11 20:59:10 +02:00
rtl839x realtek: drop support for 6.12 2026-04-11 20:59:10 +02:00
rtl930x generic: net: phy: realtek: add 5G and 10G PHY support 2026-05-21 17:04:55 +01:00
rtl930x_nand generic: net: phy: realtek: add 5G and 10G PHY support 2026-05-21 17:04:55 +01:00
rtl931x realtek: add generic support for Zyxel XS1930 lineup 2026-04-20 11:13:06 +02:00
rtl931x_nand realtek: drop support for 6.12 2026-04-11 20:59:10 +02:00
Makefile realtek: switch to 6.18 2026-04-11 20:59:10 +02:00
modules.mk kernel: mfd: Add Hasivo STC8 mfd 2026-03-01 18:47:27 +01:00