Re: [PATCH net-next v4 3/3] net: phy: add a PHY write barrier when disabling interrupts

Charles Perry
2026-04-02T17:51:20Z

On Thu, Apr 02, 2026 at 03:31:52PM +0200, Andrew Lunn wrote:
> > +static int phy_write_barrier(struct phy_device *phydev)
> > +{
> > + int err;
> > +
> > + err = phy_read(phydev, MII_PHYSID1);
> > + if (err < 0)
> > + return err;
>
> There are a small number of MDIO busses which don't implement C22,
> only C45. You are likely to get -EIO or maybe ENODEV, -EOPNOTSUPP,
> -EINVAL for such a read. Returning the error than makes
> phy_disable_interrupts() fail, etc.

Ok, I didn't know about this. Do you think there's any merit in handling
the case where phydev->mdio.bus->read is NULL and doing a C45 access in
that case?

>
> This is why i suggested throwing away the return value.

Ok

Thanks,
Charles

>
> Maybe call phydev_info() if there is an error, but i suggest making
> this a void function.
>
> Andrew
>
> ---
> pw-bot: cr