From: Yongzhao Chen <yongzhao.derek@gmail.com>
To: netdev@vger.kernel.org
Cc: Christian Marangi <ansuelsmth@gmail.com>,
Andrew Lunn <andrew@lunn.ch>, Vladimir Oltean <olteanv@gmail.com>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@kernel.org>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
John Crispin <john@phrozen.org>,
linux-kernel@vger.kernel.org
Subject: [PATCH net v2 0/3] net: dsa: qca8k: fix MDIO error handling
Date: Tue, 29 Sep 2026 00:06:26 +0200 [thread overview]
Message-ID: <20260928220629.238-1-yongzhao.derek@gmail.com> (raw)
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
next reply other threads:[~2026-09-28 22:06 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-28 22:06 Yongzhao Chen [this message]
2026-09-28 22:06 ` [PATCH net v2 1/3] net: dsa: qca8k: propagate MDIO errors Yongzhao Chen
2026-09-29 0:13 ` Andrew Lunn
2026-09-29 0:15 ` Andrew Lunn
2026-09-30 21:23 ` Yongzhao Chen
2026-09-28 22:06 ` [PATCH net v2 2/3] net: dsa: qca8k: do not clear MASTER_EN after a failed page select Yongzhao Chen
2026-09-28 22:06 ` [PATCH net v2 3/3] net: dsa: qca8k: fail mgmt Ethernet MDIO access on busy wait errors Yongzhao Chen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260928220629.238-1-yongzhao.derek@gmail.com \
--to=yongzhao.derek@gmail.com \
--cc=andrew@lunn.ch \
--cc=ansuelsmth@gmail.com \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=john@phrozen.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=olteanv@gmail.com \
--cc=pabeni@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®