net: phy: improve phy_disable_eee_mode

If a mode is to be disabled, remove it from advertising_eee.
Disabling EEE modes shall be done before calling phy_start(),
warn if that's not the case.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Link: https://patch.msgid.link/92164896-38ff-4474-b98b-e83fc05b9509@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
Heiner Kallweit 2025-02-16 22:16:34 +01:00 committed by Jakub Kicinski
parent 8a6a77bb5a
commit a9b6a860d7

View File

@ -1355,7 +1355,10 @@ static inline bool phy_is_started(struct phy_device *phydev)
*/
static inline void phy_disable_eee_mode(struct phy_device *phydev, u32 link_mode)
{
WARN_ON(phy_is_started(phydev));
linkmode_set_bit(link_mode, phydev->eee_disabled_modes);
linkmode_clear_bit(link_mode, phydev->advertising_eee);
}
void phy_resolve_aneg_pause(struct phy_device *phydev);