]> git.baikalelectronics.ru Git - kernel.git/commit
net: dsa: mv88e6xxx: don't use PHY_DETECT on internal PHY's
authorMaarten Zanders <maarten.zanders@mind.be>
Mon, 11 Oct 2021 14:27:20 +0000 (16:27 +0200)
committerDavid S. Miller <davem@davemloft.net>
Tue, 12 Oct 2021 10:32:14 +0000 (11:32 +0100)
commit4a3e0aeddf091f00974b02627c157843ce382a24
tree457b7626969b5478041b4d875e28b1ff64eb45ab
parent74a3bc42fe514098030a78c1ad5e6024463dd378
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.

Fixes: 5d5b231da7ac (net: dsa: mv88e6xxx: use PHY_DETECT in mac_link_up/mac_link_down)
Reported-by: Maarten Zanders <m.zanders@televic.com>
Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Signed-off-by: Maarten Zanders <maarten.zanders@mind.be>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/dsa/mv88e6xxx/chip.c