Skip to content

Commit 516a5f1

Browse files
hkallweitkuba-moo
authored andcommitted
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>
1 parent c1ddfdb commit 516a5f1

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

drivers/net/phy/phy-c45.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1568,11 +1568,10 @@ int genphy_c45_ethtool_set_eee(struct phy_device *phydev,
15681568
phydev_warn(phydev, "At least some EEE link modes are not supported.\n");
15691569
return -EINVAL;
15701570
}
1571-
} else {
1572-
adv = phydev->supported_eee;
1571+
linkmode_copy(phydev->advertising_eee, adv);
1572+
} else if (linkmode_empty(phydev->advertising_eee)) {
1573+
phy_advertise_eee_all(phydev);
15731574
}
1574-
1575-
linkmode_copy(phydev->advertising_eee, adv);
15761575
}
15771576

15781577
phydev->eee_enabled = data->eee_enabled;

0 commit comments

Comments
 (0)