FAILED: patch "[PATCH] net: dsa: mv88e6xxx: don't use PHY_DETECT on internal PHY's" failed to apply to 5.10-stable tree
Subsystems (4)
[email protected]
maintainerThe patch below does not apply to the 5.10-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 4a3e0aeddf091f00974b02627c157843ce382a24 Mon Sep 17 00:00:00 2001
From: Maarten Zanders <[email protected]>
Date: Mon, 11 Oct 2021 16:27:20 +0200
Subject: [PATCH] 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.
drivers/net/dsa/mv88e6xxx/chip.c +11 -2
@@ -750,7 +750,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_sync_link) err = ops->port_sync_link (chip, port, mode, false);mv88e6xxx_reg_unlock (chip);
@@ -773,7 +777,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