Skip to contentSkip to conversation

net: phy: fix phy_disable_eee

PATCH Applied Heiner Kallweit 2 participants 2 messages Dec 20, 2024 – Jan 3, 2025

Subsystems (3)
lore
Share & tools
lore

Heiner Kallweit

author maintainer
#0 lore raw

PATCH 1/1 net: phy: fix phy_disable_eee

genphy_c45_write_eee_adv() becomes a no-op if phydev->supported_eee is cleared. That's not what we want because this function is still needed to clear the EEE advertisement register(s).
Fill phydev->eee_broken_modes instead to ensure that userspace can't re-enable EEE advertising.

Fixes b55498ff14bd ("net: phy: add phy_disable_eee")
---
 drivers/net/phy/phy_device.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/phy/phy_device.c +2 -1
index 928dc3c50..6e169fced 100644
@@ -3012,10 +3012,11 @@ EXPORT_SYMBOL(phy_support_eee);
  */
 void phy_disable_eee(struct phy_device *phydev)
 {
-	linkmode_zero(phydev->supported_eee);
 	linkmode_zero(phydev->advertising_eee);
 	phydev->eee_cfg.tx_lpi_enabled = false;
 	phydev->eee_cfg.eee_enabled = false;
+	/* don't let userspace re-enable EEE advertisement */
+	linkmode_fill(phydev->eee_broken_modes);
 }
 EXPORT_SYMBOL_GPL(phy_disable_eee);
 
Signature · 1 line
2.47.1
#1 lore raw
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Quoted 10 lines · On Fri, 20 Dec 2024 23:02:06 +0100 you wrote:

genphy_c45_write_eee_adv() becomes a no-op if phydev->supported_eee is cleared. That's not what we want because this function is still needed to clear the EEE advertisement register(s).
Fill phydev->eee_broken_modes instead to ensure that userspace can't re-enable EEE advertising.

Fixes b55498ff14bd ("net: phy: add phy_disable_eee")

[...]

Here is the summary with links:
- [net-next] net: phy: fix phy_disable_eee

    https://git.kernel.org/netdev/net-next/c/c83ca5a4df7c

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html