Skip to content

Commit

Permalink
net: phy: improve phy_disable_eee_mode
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Heiner Kallweit authored and Jakub Kicinski committed Feb 19, 2025
1 parent 8a6a77b commit a9b6a86
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions include/linux/phy.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit a9b6a86

Please sign in to comment.