I have the issue that suspending the MAC-integrated PHY gives an
error during system suspend. The sequence is:

1. unconnected PHY/MAC are runtime-suspended already
2. system suspend commences
3. mdio_bus_phy_suspend is called
4. suspend callback of the network driver is called (implicitly
   MAC/PHY are runtime-resumed before)
5. suspend callback suspends MAC/PHY

The problem occurs in step 3. phy_suspend() fails because the MDIO
bus isn't accessible due to the chip being runtime-suspended.

This series mainly adds a check to not suspend the PHY if the
MDIO bus parent is runtime-suspended.

Changes in v2:
- Check for MDIO bus parent being runtime-suspended before calling
  phy_ethtool_get_wol() which could access the MDIO bus.

Heiner Kallweit (2):
  net: phy: improve check for when to call phy_resume in mdio_bus_phy_resume
  net: phy: improve checks when to suspend the PHY

 drivers/net/phy/phy_device.c | 45 +++++++++++++++++++++---------------
 1 file changed, 26 insertions(+), 19 deletions(-)

-- 
2.17.0

Reply via email to