aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHeiner Kallweit <[email protected]>2024-12-20 22:02:06 +0000
committerJakub Kicinski <[email protected]>2025-01-03 01:09:09 +0000
commitc83ca5a4df7cf0ce9ccc25e8481043e05aed6ad0 (patch)
tree5a76fad42d676c51b4df82db8d070d6f8a466a4a
parentMerge branch 'net-lan969x-add-rgmii-support' (diff)
downloadkernel-c83ca5a4df7cf0ce9ccc25e8481043e05aed6ad0.tar.gz
kernel-c83ca5a4df7cf0ce9ccc25e8481043e05aed6ad0.zip
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") Signed-off-by: Heiner Kallweit <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
-rw-r--r--drivers/net/phy/phy_device.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
index 928dc3c509b6..bdc997f59779 100644
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
@@ -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);