diff options
author | Heiner Kallweit <hkallweit1@gmail.com> | 2025-02-16 22:16:34 +0100 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2025-02-18 18:07:08 -0800 |
commit | a9b6a860d7789d8183530aedbb46cf70f843e40d (patch) | |
tree | a0b9517382cbf67290e58961fd1fbdb296bc4a9f /include/linux/phy.h | |
parent | 8a6a77bb5a41d5a91c6155e1b902d9f75b5bf9a6 (diff) |
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>
Diffstat (limited to 'include/linux/phy.h')
-rw-r--r-- | include/linux/phy.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/phy.h b/include/linux/phy.h index 96ea56de71b2..0d5da01d275c 100644 --- a/include/linux/phy.h +++ b/include/linux/phy.h @@ -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); |