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

Russell King (Oracle)
2026-04-02T18:03:47Z

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.

If it returns -EOPNOTSUPP (meaning, at least, that bus->read is not
implemented), do we want to issue a C45 read instead?

--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!