--- zzzz-none-000/linux-4.4.271/drivers/net/phy/phy_device.c 2021-06-03 06:22:09.000000000 +0000 +++ hawkeye-5590-750/linux-4.4.271/drivers/net/phy/phy_device.c 2023-04-19 10:22:29.000000000 +0000 @@ -183,6 +183,10 @@ dev->state = PHY_DOWN; + /* AVM start */ + dev->avm_no_suspend = false; + /* AVM end */ + mutex_init(&dev->lock); INIT_DELAYED_WORK(&dev->state_queue, phy_state_machine); INIT_WORK(&dev->phy_queue, phy_change); @@ -742,6 +746,9 @@ struct mii_bus *bus; int i; + if (phydev->drv && phydev->drv->detach) + phydev->drv->detach(phydev); + phydev->attached_dev->phydev = NULL; phydev->attached_dev = NULL; phy_suspend(phydev); @@ -777,7 +784,12 @@ /* If the device has WOL enabled, we cannot suspend the PHY */ phy_ethtool_get_wol(phydev, &wol); - if (wol.wolopts) + /* AVM/PME: Use Flag set by ssdk(_dts) here + * to fix LED on F!PLC 1260Ev1. So return + * with error like wol check + * because we don't want PHY suspend. + */ + if (wol.wolopts || phydev->avm_no_suspend) return -EBUSY; if (phydrv->suspend) @@ -1003,6 +1015,9 @@ { int status; + if (phydev->drv->update_link) + return phydev->drv->update_link(phydev); + /* Do a fake read */ status = phy_read(phydev, MII_BMSR); if (status < 0)