[PATCH net-next v3 0/3] net: dsa: qca8k: fix MDIO error handling
From: Yongzhao Chen
Date: Sat Oct 03 2026 - 13:24:47 EST
This series fixes qca8k MDIO error-handling bugs found by code
inspection and the Sashiko review of v1 [1]. I am not aware of reports
of actual MDIO failures, so v3 targets net-next without Fixes tags, as
Andrew requested [2].
The patches propagate register and PHY access errors, skip MASTER_EN
cleanup after a failed page select, invalidate the uncertain page cache,
and return management Ethernet busy-wait errors so MDIO fallback can run.
They apply directly to net-next; the separate qca8k MTU series depends on
the write-error propagation provided here.
Testing: the base and each patch build with W=1 for arm64
(drivers/net/dsa/qca, net/dsa, drivers/net/phy/qcom). A userspace model
compiles the driver's own MDIO functions against a simulated paged
switch and a scripted management Ethernet responder, with phylib's
read-modify-write helper as a consumer. Fault injection leaves 15 failing
cases on the base, 10 after patch 1, seven after patch 2, and none after
patch 3. These are model tests, not kernel selftests or hardware error
injection.
A Redmi AX5400 (RA74, IPQ5018 + QCA8337) passed connectivity checks
with a 6.18.52 OpenWrt backport of v2 after boot, reboot, one cold boot,
link re-initialization and MTU changes. Its switch PHYs are on the SoC
MDIO bus and it has no CPU port 0. This covers normal register access
through page selection; the internal MDIO master and management
Ethernet paths remain tested only in the model.
v3:
- Target net-next and drop the Fixes: tags as requested [2]. Historical
commits are identified in the commit messages instead.
- Order local variable declarations in reverse Christmas tree order in
the functions the series touches [3]. No other code change.
Previous versions:
v2 [4], v1 [5].
[1] https://lore.kernel.org/netdev/179054715863.3145.10179961093285192493@xxxxxxxxxx/
[2] https://lore.kernel.org/netdev/12875133-1659-4507-a007-c3cfa425ec76@xxxxxxx/
[3] https://lore.kernel.org/netdev/f7889e9e-8ca8-47b1-b902-c31e7c016858@xxxxxxx/
[4] https://lore.kernel.org/netdev/20260928220629.238-1-yongzhao.derek@xxxxxxxxx/
[5] https://lore.kernel.org/netdev/20260923215748.1336-1-yongzhao.derek@xxxxxxxxx/
Yongzhao Chen (3):
net: dsa: qca8k: propagate MDIO errors
net: dsa: qca8k: do not clear MASTER_EN after a failed page select
net: dsa: qca8k: fail mgmt Ethernet MDIO access on busy wait errors
drivers/net/dsa/qca/qca8k-8xxx.c | 68 +++++++++++++++++++-------------
1 file changed, 40 insertions(+), 28 deletions(-)
base-commit: cfb7793d1bc0f7d90571611979654cf1b3886b29
--
2.43.0