diff options
author | Florian Fainelli <f.fainelli@gmail.com> | 2021-03-10 14:17:58 -0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-03-30 14:35:25 +0200 |
commit | da8af444b32566696de125895af2bc88bde0faac (patch) | |
tree | 55a5175a4b4dab0299e0d6b3e7af18e05ee54867 /drivers/net/dsa/bcm_sf2.c | |
parent | 267b79a11046110590ccc360c851fb57ffd34b6c (diff) | |
download | linux-stable-da8af444b32566696de125895af2bc88bde0faac.tar.gz linux-stable-da8af444b32566696de125895af2bc88bde0faac.tar.bz2 linux-stable-da8af444b32566696de125895af2bc88bde0faac.zip |
net: dsa: bcm_sf2: Qualify phydev->dev_flags based on port
[ Upstream commit 47142ed6c34d544ae9f0463e58d482289cbe0d46 ]
Similar to commit 92696286f3bb37ba50e4bd8d1beb24afb759a799 ("net:
bcmgenet: Set phydev->dev_flags only for internal PHYs") we need to
qualify the phydev->dev_flags based on whether the port is connected to
an internal or external PHY otherwise we risk having a flags collision
with a completely different interpretation depending on the driver.
Fixes: aa9aef77c761 ("net: dsa: bcm_sf2: communicate integrated PHY revision to PHY driver")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/net/dsa/bcm_sf2.c')
-rw-r--r-- | drivers/net/dsa/bcm_sf2.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/net/dsa/bcm_sf2.c b/drivers/net/dsa/bcm_sf2.c index ca425c15953b..0ee1c0a7b165 100644 --- a/drivers/net/dsa/bcm_sf2.c +++ b/drivers/net/dsa/bcm_sf2.c @@ -479,8 +479,10 @@ static u32 bcm_sf2_sw_get_phy_flags(struct dsa_switch *ds, int port) * in bits 15:8 and the patch level in bits 7:0 which is exactly what * the REG_PHY_REVISION register layout is. */ - - return priv->hw_params.gphy_rev; + if (priv->int_phy_mask & BIT(port)) + return priv->hw_params.gphy_rev; + else + return 0; } static void bcm_sf2_sw_validate(struct dsa_switch *ds, int port, |