[PATCH net v2 0/3] net: dsa: qca8k: fix MDIO error handling
From: Yongzhao Chen <hidden>
Date: 2026-09-28 22:06:50
These patches fix error handling in the qca8k internal MDIO master paths. Patch 1 propagates MDIO read and write errors instead of reporting success or returning 0xffff. Apart from the trailers it is the v1 patch. Patches 2 and 3 fix the two problems the Sashiko review found around v1 [1]. Both predate v1: - After a failed page select, the MASTER_EN cleanup write went to whichever page the switch still had selected, which can clear the upper half of an unrelated register. The page cache also kept the old page even though the failed write may have reached the switch. - A management Ethernet busy wait that timed out with successful poll requests carried on to the data read, so a read could return data from an incomplete transaction and never fall back to the MDIO bus. Testing: each patch builds with W=1 for arm64 (drivers/net/dsa/qca, net/dsa, drivers/net/phy/qcom), and checkpatch --strict reports only the missing sign-off and the Fixes: IDs that my shallow clone cannot resolve. A userspace model compiles the driver's own MDIO functions against a simulated paged switch and a scripted management Ethernet responder, including phylib's read-modify-write helper as a consumer. Each patch fixes its own cases; the base fails all of them. A Redmi AX5400 (IPQ5018 + QCA8337) was tested with a 6.18 backport of this series in OpenWrt. Connectivity was verified after boot, reboot, cold boot, link re-initialization and MTU changes. That board has its switch PHYs on the SoC MDIO bus and no CPU port 0, so it never uses the internal MDIO master or management Ethernet. On hardware this only shows that normal register access through the page select path still works. v2: - Patch 1: removed the blank line between Fixes: and the other trailers; Cc John Crispin, author of the commit named in Fixes:. - Patches 2 and 3 are new. v1: https://lore.kernel.org/netdev/20260923215748.1336-1-yongzhao.derek@gmail.com/ [1] https://lore.kernel.org/netdev/179054715863.3145.10179961093285192493@kernel.org/ 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 | 66 +++++++++++++++++++------------- 1 file changed, 39 insertions(+), 27 deletions(-) base-commit: a7bfaba4823e3c165bb2004c74eff7c096672bc7 -- 2.43.0