[PATCH net 2/3] net: dsa: mt7530: error out on failed reads in ATC/VTCR command polling

Andrew Lunn andrew at lunn.ch
Tue Jul 28 13:59:19 PDT 2026


On Tue, Jul 28, 2026 at 05:52:21AM +0100, Daniel Golle wrote:
> mt7530_fdb_cmd() and mt7530_vlan_cmd() poll the command register
> through a helper which returns 0 when the underlying read fails. A
> failed bus transaction thus clears ATC_BUSY/VTCR_BUSY and is treated
> as successful command completion, and the subsequent ATC_INVALID and
> VTCR_INVALID checks are defeated the same way.
> 
> Poll using regmap_read_poll_timeout(), which stops on read errors and
> propagates them, and check the completion status read as well. Take
> the MDIO bus lock across the sequence as the switch regmap is set up
> with locking disabled.
> 
> Fixes: b8f126a8d543 ("net-next: dsa: add dsa support for Mediatek MT7530 switch")
> Fixes: 83163f7dca56 ("net: dsa: mediatek: add VLAN support for MT7530")
> Signed-off-by: Daniel Golle <daniel at makrotopia.org>

Reviewed-by: Andrew Lunn <andrew at lunn.ch>

    Andrew



More information about the Linux-mediatek mailing list