Commit 92b0c8dd authored by Heiner Kallweit's avatar Heiner Kallweit Committed by Greg Kroah-Hartman

net: phy: fix flag masking in __set_phy_supported

[ Upstream commit df8ed346 ]

Currently also the pause flags are removed from phydev->supported because
they're not included in PHY_DEFAULT_FEATURES. I don't think this is
intended, especially when considering that this function can be called
via phy_set_max_speed() anywhere in a driver. Change the masking to mask
out only the values we're going to change. In addition remove the
misleading comment, job of this small function is just to adjust the
supported and advertised speeds.

Fixes: f3a6bd39 ("phylib: Add phy_set_max_speed helper")
Signed-off-by: default avatarHeiner Kallweit <hkallweit1@gmail.com>
Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent be64f9f7
...@@ -1265,11 +1265,8 @@ static int gen10g_resume(struct phy_device *phydev) ...@@ -1265,11 +1265,8 @@ static int gen10g_resume(struct phy_device *phydev)
static int __set_phy_supported(struct phy_device *phydev, u32 max_speed) static int __set_phy_supported(struct phy_device *phydev, u32 max_speed)
{ {
/* The default values for phydev->supported are provided by the PHY phydev->supported &= ~(PHY_1000BT_FEATURES | PHY_100BT_FEATURES |
* driver "features" member, we want to reset to sane defaults first PHY_10BT_FEATURES);
* before supporting higher speeds.
*/
phydev->supported &= PHY_DEFAULT_FEATURES;
switch (max_speed) { switch (max_speed) {
default: default:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment