Re: [PATCH net-next v2] net: phy: air_en8811h: check PBUS register read errors

From: Zhao Li

Date: Sat Nov 21 2026 - 07:28:40 EST


On Fri, Nov 20, 2026 at 02:15:00PM +0100, Andrew Lunn wrote:
> > /* We do not know what errors this check is supposed
> > * catch or what to do about a failure. So print the
> > * result and continue like the vendor driver does.
> > */
> > if (pbus_value & AN8811HB_CRC_ST) {
> > - air_phy_buckpbus_reg_read(phydev, mon3, &pbus_value);
> > + ret = air_phy_buckpbus_reg_read(phydev, mon3,
> > + &pbus_value);
> > + if (ret < 0)
> > + return ret;
>
> Please could you explain your understanding how this change and the
> comment go together? You did read the comment didn't you?

Yes, I did.

The failure mentioned in the comment is a firmware CRC mismatch
(AN8811HB_CRC_CHECK_PASS clear in mon3 once AN8811HB_CRC_ST is set in
mon2). That behavior is unchanged: when reading mon3 succeeds, a CRC
FAIL is only logged via phydev_dbg(), AN8811HB_CRC_RD_EN is cleared,
and firmware loading continues.

The added check handles a PBUS/MDIO register read failure instead. If
air_phy_buckpbus_reg_read() returns an error, pbus_value is not updated
and still holds the mon2 status word, so phydev_dbg() would report PASS
or FAIL decoded from the wrong register.

an8811hb_check_crc() already propagates PBUS errors from the
air_phy_buckpbus_reg_modify() calls at the start and end of the check
(and returns -ENODEV on timeout), so propagating errors from the three
PBUS reads in between keeps bus-error handling consistent.

If the comment now looks misleading right above the mon3 read check, I
can move it down above phydev_dbg() in a v3.

Thanks,
Zhao