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: f3a6bd393c2c ("phylib: Add phy_set_max_speed helper")
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
drivers/net/phy/phy_device.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
@@ -1724,11 +1724,8 @@ EXPORT_SYMBOL(genphy_loopback);staticint__set_phy_supported(structphy_device*phydev,u32max_speed){-/* The default values for phydev->supported are provided by the PHY-*driver"features"member,wewanttoresettosanedefaultsfirst-*beforesupportinghigherspeeds.-*/-phydev->supported&=PHY_DEFAULT_FEATURES;+phydev->supported&=~(PHY_1000BT_FEATURES|PHY_100BT_FEATURES|+PHY_10BT_FEATURES);switch(max_speed){default:
From: Andrew Lunn <andrew@lunn.ch> Date: 2018-07-04 14:13:14
On Tue, Jul 03, 2018 at 10:34:54PM +0200, Heiner Kallweit wrote:
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: f3a6bd393c2c ("phylib: Add phy_set_max_speed helper")
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
On July 3, 2018 10:34:54 PM GMT+02:00, Heiner Kallweit [off-list ref] wrote:
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: f3a6bd393c2c ("phylib: Add phy_set_max_speed helper")
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
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: f3a6bd393c2c ("phylib: Add phy_set_max_speed helper")
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>