Message ID | 487d87a1-7268-4ef4-9bde-435e61c7495c@gmail.com (mailing list archive) |
---|---|
State | New |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | net: phy: improve phylib EEE handling | expand |
diff --git a/include/linux/phy.h b/include/linux/phy.h index ad71d3a3b..fce29aaa9 100644 --- a/include/linux/phy.h +++ b/include/linux/phy.h @@ -1333,7 +1333,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);
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> --- include/linux/phy.h | 3 +++ 1 file changed, 3 insertions(+)