Re: [PATCH net 2/3] net: dsa: mt7530: error out on failed reads in ATC/VTCR command polling
From: Andrew Lunn
Date: Tue Jul 28 2026 - 17:01:34 EST
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@xxxxxxxxxxxxxx>
Reviewed-by: Andrew Lunn <andrew@xxxxxxx>
Andrew