Re: [PATCH net v2 1/3] net: dsa: qca8k: propagate MDIO errors

From: Andrew Lunn

Date: Mon Sep 28 2026 - 20:16:00 EST


On Tue, Sep 29, 2026 at 12:06:27AM +0200, Yongzhao Chen wrote:
> qca8k_mii_write32() ignores errors from both 16-bit half-word writes.
> Its callers (register writes and read-modify-write helpers) then return
> the earlier successful page selection or read result, incorrectly
> reporting success even when writing the switch register failed.
>
> Propagate write errors from both the low and high half-words through the
> regmap paths and internal MDIO master transactions. Attempt to clear
> MASTER_EN even if a transaction fails, preserving the initial error, and
> report a cleanup failure if the transaction itself succeeded. Preserve
> the existing Ethernet-to-MDIO fallback order.
>
> Propagate read errors through the internal and legacy MDIO bus callbacks
> instead of masking them as 0xffff. Returning 0xffff causes PHY
> read-modify-write callers to treat the failed read as valid register
> data, which can corrupt unrelated bits on writeback.
>
> Stop polling when reading the MDIO busy status fails, and return the
> error immediately. Because the read helper clears its output on failure,
> checking only the BUSY bit mistakes an unsuccessful read for transaction
> completion.
>
> Fixes: 6b93fb46480a ("net-next: dsa: add new driver for qca8xxx family")

Does this actually bother anybody? Have there been reports of actual
MDIO errors?

If not, please drop the Fixes: tag and post for net-next.

Andrew