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 <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
This commit is contained in:
Heiner Kallweit authored and Jakub Kicinski committed 2024-11-06 17:33:10 -08:00
1 parent c1ddfdbee3
commit 516a5f11eb
1 file changed
+3 -4
+3 -4
View File
@@ -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;