From: Yi Cong When resuming a PHY device that is not attached to a MAC (i.e. phydev->attached_dev is NULL), mdio_bus_phy_resume() may call into phy_init_hw() -> phydev->drv->config_init(), which can return -EOPNOTSUPP (-95) if the driver does not support initialization in this state. This results in log messages like: [ 1905.106209] YT8531S Gigabit Ethernet xxxxmac_mii_bus-XXXX:00:01: PM: dpm_run_callback(): mdio_bus_phy_resume+0x0/0x180 [libphy] returns -95 [ 1905.106232] YT8531S Gigabit Ethernet xxxxmac_mii_bus-XXXX:00:01: PM: failed to resume: error -95 In practice, only one PHY on the bus (e.g. XXXX:00:00) is typically attached to a MAC interface; others (like XXXX:00:01) are probed but not used, making such resume attempts unnecessary and misleading. Add an early return in mdio_bus_phy_resume() when !phydev->attached_dev, to prevent unneeded hardware initialization and avoids false error reports. Fixes: 611d779af7ca ("net: phy: fix MDIO bus PM PHY resuming") Signed-off-by: Yi Cong --- drivers/net/phy/phy_device.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c index 7556aa3dd7ee..e8b4be967832 100644 --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c @@ -373,6 +373,9 @@ static __maybe_unused int mdio_bus_phy_resume(struct device *dev) struct phy_device *phydev = to_phy_device(dev); int ret; + if (!phydev->attached_dev) + return 0; + if (phydev->mac_managed_pm) return 0; -- 2.25.1