All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net 0/3] net: dsa: mt7530: fix swallowed MDIO read errors
@ 2026-07-28  4:52 Daniel Golle
  2026-07-28  4:52 ` [PATCH net 1/3] net: dsa: mt7530: check bus->read() errors in the MDIO regmap backend Daniel Golle
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Daniel Golle @ 2026-07-28  4:52 UTC (permalink / raw)
  To: Chester A. Unal, Daniel Golle, Andrew Lunn, Vladimir Oltean,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Matthias Brugger, AngeloGioacchino Del Regno, Landen Chao,
	Florian Fainelli, Sean Wang, netdev, linux-kernel,
	linux-arm-kernel, linux-mediatek

While working on a register access cleanup for the mt7530 driver, the
Sashiko AI reviewers flagged long-standing error handling gaps in the
driver's read paths [1].

The MDIO regmap backend truncates negative bus->read() errnos into u16
register halves and returns success, handing garbage data to callers
and to read-modify-write cycles which then write it back to the switch.

The ATC/VTCR command polls and the MT7531 indirect PHY polls consume
reads through a helper which returns 0 when the underlying read fails.
A failed bus transaction thus clears the polled busy bit and is
mistaken for command completion, defeats the subsequent
ATC_INVALID/VTCR_INVALID checks the same way, and lets the indirect
PHY access functions return garbage PHY register data.

Fix the backend to propagate bus->read() errors, and convert the
command and PHY access polls to regmap_read_poll_timeout(), which
terminates polling on read errors and propagates them.

The cleanup series depending on these fixes will be submitted to
net-next separately after the next net/net-next merger.

[1] https://lore.kernel.org/netdev/cover.1784481922.git.daniel@makrotopia.org/

Daniel Golle (3):
  net: dsa: mt7530: check bus->read() errors in the MDIO regmap backend
  net: dsa: mt7530: error out on failed reads in ATC/VTCR command
    polling
  net: dsa: mt7530: error out on failed reads in MT7531 PHY polling

 drivers/net/dsa/mt7530-mdio.c | 11 ++++-
 drivers/net/dsa/mt7530.c      | 86 ++++++++++++++++-------------------
 2 files changed, 47 insertions(+), 50 deletions(-)


base-commit: a50eba1e778ad4da5b6f9ddbbf57dabbea59bc05
-- 
2.55.0

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

end of thread, other threads:[~2026-07-28  4:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-28  4:52 [PATCH net 0/3] net: dsa: mt7530: fix swallowed MDIO read errors Daniel Golle
2026-07-28  4:52 ` [PATCH net 1/3] net: dsa: mt7530: check bus->read() errors in the MDIO regmap backend Daniel Golle
2026-07-28  4:52 ` [PATCH net 2/3] net: dsa: mt7530: error out on failed reads in ATC/VTCR command polling Daniel Golle
2026-07-28  4:52 ` [PATCH net 3/3] net: dsa: mt7530: error out on failed reads in MT7531 PHY polling Daniel Golle

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.