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

Andrew Lunn
2026-04-02T13:32:11Z

> +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.

This is why i suggested throwing away the return value.

Maybe call phydev_info() if there is an error, but i suggest making
this a void function.

Andrew

---
pw-bot: cr