net: dsa: mt7530: error out on failed reads in MT7531 PHY polling
authorDaniel Golle <daniel@makrotopia.org>
Tue, 28 Jul 2026 04:52:29 +0000 (05:52 +0100)
committerJakub Kicinski <kuba@kernel.org>
Thu, 30 Jul 2026 00:30:14 +0000 (17:30 -0700)
commit77a9ebe8818cf6dd1699bd6728cb5d66307801d7
tree0056116e8a05956d83cdbe3fc266a04823d81f80
parented9adac35b8fac635f40e28461505e2e5b6c8fcc
net: dsa: mt7530: error out on failed reads in MT7531 PHY polling

The MT7531 indirect PHY access functions poll MT7531_PHY_IAC through
a helper which returns 0 when the underlying read fails, so a failed
bus transaction clears MT7531_PHY_ACS_ST and the access carries on,
returning garbage PHY register data to phylib.

Poll using regmap_read_poll_timeout(), which stops on read errors and
propagates them. These functions hold the MDIO bus lock across the
whole sequence, so the unlocked regmap accesses remain correct. Remove
the now-unused _mt7530_unlocked_read().

Fixes: c288575f7810 ("net: dsa: mt7530: Add the support of MT7531 switch")
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Link: https://patch.msgid.link/79e85d68d210cc37342978171aa6432aa2954333.1785213071.git.daniel@makrotopia.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/dsa/mt7530.c