Re: [PATCH net 1/3] net: dsa: mt7530: check bus->read() errors in the MDIO regmap backend

Andrew Lunn <[email protected]> Tue, 28 Jul 2026 22:57:11 +0200
Newsgroups org.infradead.lists.linux-mediatek,org.infradead.lists.linux-arm-kernel,org.kernel.vger.linux-kernel,org.kernel.vger.netdev
Message-ID <[email protected]>
On Tue, Jul 28, 2026 at 05:52:14AM +0100, Daniel Golle wrote:
> bus->read() returns a negative errno on failure, but
> mt7530_regmap_read() assigns it to a u16, truncating e.g. -ETIMEDOUT
> into 0xff92, and returns success. The garbage word is then consumed as
> register data, and read-modify-write cycles write it back to the
> switch. Check both reads and propagate their errors.
> 
> The same defect existed in mt7530_mii_read() since the driver was
> introduced and moved into the regmap backend unchanged.
> 
> Fixes: b8f126a8d543 ("net-next: dsa: add dsa support for Mediatek MT7530 switch")
> Signed-off-by: Daniel Golle <[email protected]>

Reviewed-by: Andrew Lunn <[email protected]>

    Andrew