Skip to content

Commit 4a3e0ae

Browse files
mzandersdavem330
authored andcommitted
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: 5d5b231 (net: dsa: mv88e6xxx: use PHY_DETECT in mac_link_up/mac_link_down) Reported-by: Maarten Zanders <[email protected]> Reviewed-by: Maxime Chevallier <[email protected]> Signed-off-by: Maarten Zanders <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 74a3bc4 commit 4a3e0ae

File tree

1 file changed

+11
-2
lines changed
  • drivers/net/dsa/mv88e6xxx

1 file changed

+11
-2
lines changed

drivers/net/dsa/mv88e6xxx/chip.c

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -750,7 +750,11 @@ static void mv88e6xxx_mac_link_down(struct dsa_switch *ds, int port,
750750
ops = chip->info->ops;
751751

752752
mv88e6xxx_reg_lock(chip);
753-
if ((!mv88e6xxx_port_ppu_updates(chip, port) ||
753+
/* Internal PHYs propagate their configuration directly to the MAC.
754+
* External PHYs depend on whether the PPU is enabled for this port.
755+
*/
756+
if (((!mv88e6xxx_phy_is_internal(ds, port) &&
757+
!mv88e6xxx_port_ppu_updates(chip, port)) ||
754758
mode == MLO_AN_FIXED) && ops->port_sync_link)
755759
err = ops->port_sync_link(chip, port, mode, false);
756760
mv88e6xxx_reg_unlock(chip);
@@ -773,7 +777,12 @@ static void mv88e6xxx_mac_link_up(struct dsa_switch *ds, int port,
773777
ops = chip->info->ops;
774778

775779
mv88e6xxx_reg_lock(chip);
776-
if (!mv88e6xxx_port_ppu_updates(chip, port) || mode == MLO_AN_FIXED) {
780+
/* Internal PHYs propagate their configuration directly to the MAC.
781+
* External PHYs depend on whether the PPU is enabled for this port.
782+
*/
783+
if ((!mv88e6xxx_phy_is_internal(ds, port) &&
784+
!mv88e6xxx_port_ppu_updates(chip, port)) ||
785+
mode == MLO_AN_FIXED) {
777786
/* FIXME: for an automedia port, should we force the link
778787
* down here - what if the link comes up due to "other" media
779788
* while we're bringing the port up, how is the exclusivity

0 commit comments

Comments
 (0)