summaryrefslogtreecommitdiffstats
path: root/drivers/net/phy
diff options
context:
space:
mode:
authorHeiner Kallweit <hkallweit1@gmail.com>2024-11-01 20:35:41 +0100
committerJakub Kicinski <kuba@kernel.org>2024-11-06 17:33:10 -0800
commit516a5f11eb97c68b4a5e8b3dc20ced1763b9e941 (patch)
tree4eff68e847f1c780bc7ac6c9411dbc9f3f3e4a73 /drivers/net/phy
parentc1ddfdbee36952b4e494bd372b35f8a13106dbc1 (diff)
downloadlinux-516a5f11eb97c68b4a5e8b3dc20ced1763b9e941.tar.gz
linux-516a5f11eb97c68b4a5e8b3dc20ced1763b9e941.tar.bz2
linux-516a5f11eb97c68b4a5e8b3dc20ced1763b9e941.zip
net: phy: respect cached advertising when re-enabling EEE
If we remove modes from EEE advertisement and disable / re-enable EEE, then advertisement is set to all supported modes. I don't think this is what the user expects. So respect the cached advertisement and just fall back to all supported modes if cached advertisement is empty. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Link: https://patch.msgid.link/c75f7f8b-5571-429f-abd3-ce682d178a4b@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/net/phy')
-rw-r--r--drivers/net/phy/phy-c45.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/net/phy/phy-c45.c b/drivers/net/phy/phy-c45.c
index 5695935fdce9..8c4dd94c7495 100644
--- a/drivers/net/phy/phy-c45.c
+++ b/drivers/net/phy/phy-c45.c
@@ -1568,11 +1568,10 @@ int genphy_c45_ethtool_set_eee(struct phy_device *phydev,
phydev_warn(phydev, "At least some EEE link modes are not supported.\n");
return -EINVAL;
}
- } else {
- adv = phydev->supported_eee;
+ linkmode_copy(phydev->advertising_eee, adv);
+ } else if (linkmode_empty(phydev->advertising_eee)) {
+ phy_advertise_eee_all(phydev);
}
-
- linkmode_copy(phydev->advertising_eee, adv);
}
phydev->eee_enabled = data->eee_enabled;