net: dsa: mv88e6xxx: don't use PHY_DETECT on internal PHY's
PATCH 1/1 net: dsa: mv88e6xxx: don't use PHY_DETECT on internal PHY's
mv88e6xxx_port_ppu_updates() interpretes data in the PORT_STS register incorrectly for internal ports (ie no PPU). In these cases, the PHY_DETECT bit indicates link status. This results in forcing the MAC state whenever the PHY link goes down which is not intended. As a side effect, LED's configured to show link status stay lit even though the physical link is down.
Add a check in mac_link_down and mac_link_up to see if it concerns an external port and only then, look at PPU status.
Difference from upstream commit:ops->port_sync_link() renamed to ops->port_set_link()
--- drivers/net/dsa/mv88e6xxx/chip.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-)
drivers/net/dsa/mv88e6xxx/chip.c +11 -2
@@ -726,7 +726,11 @@ static void mv88e6xxx_mac_link_down(struct dsa_switch *ds, int port, ops = chip->info->ops;mv88e6xxx_reg_lock (chip); -if ((!mv88e6xxx_port_ppu_updates (chip, port) || +/* Internal PHYs propagate their configuration directly to the MAC. +* External PHYs depend on whether the PPU is enabled for this port. +*/ +if (((!mv88e6xxx_phy_is_internal (ds, port) && + !mv88e6xxx_port_ppu_updates (chip, port)) || mode ==MLO_AN_FIXED ) && ops->port_set_link) err = ops->port_set_link (chip, port,LINK_FORCED_DOWN );mv88e6xxx_reg_unlock (chip);
@@ -749,7 +753,12 @@ static void mv88e6xxx_mac_link_up(struct dsa_switch *ds, int port, ops = chip->info->ops;mv88e6xxx_reg_lock (chip); -if (!mv88e6xxx_port_ppu_updates (chip, port) || mode ==MLO_AN_FIXED ) { +/* Internal PHYs propagate their configuration directly to the MAC. +* External PHYs depend on whether the PPU is enabled for this port. +*/ +if ((!mv88e6xxx_phy_is_internal (ds, port) && + !mv88e6xxx_port_ppu_updates (chip, port)) || + mode ==MLO_AN_FIXED ) {/* FIXME: for an automedia port, should we force the link * down here - what if the link comes up due to "other" media * while we're bringing the port up, how is the exclusivity
Signature · 1 line
2.25.1
Greg KH
maintainerQuoted 13 lines · Maarten Zanders
mv88e6xxx_port_ppu_updates()interpretes data in thePORT_STSregister incorrectly for internal ports (ie no PPU). In these cases, thePHY_DETECTbit indicates link status. This results in forcing the MAC state whenever the PHY link goes down which is not intended. As a side effect, LED's configured to show link status stay lit even though the physical link is down.Add a check in
mac_link_downandmac_link_upto see if it concerns an external port and only then, look at PPU status.Difference from upstream commit:
ops->port_sync_link()renamed toops->port_set_link()
Quoted 6 lines
Fixes 5d5b231da7ac (net: dsa: mv88e6xxx: use PHY_DETECT in mac_link_up/mac_link_down)Cc <[email protected]> # 5.10Signed-off-by Maarten Zanders <[email protected]>--- drivers/net/dsa/mv88e6xxx/chip.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-)
Thanks for the backport, now queued up. But next time can you let me know what the upstream SHA1 is? I had to go dig it up...
thanks,
greg k-h