net: dsa: b53: Force flow control for BCM5301X CPU port(s)
authorFlorian Fainelli <florian.fainelli@broadcom.com>
Tue, 23 Apr 2024 18:33:35 +0000 (11:33 -0700)
committerJakub Kicinski <kuba@kernel.org>
Thu, 25 Apr 2024 18:46:38 +0000 (11:46 -0700)
Just like what b53_adjust_link() does, force flow control for the
BCM5301X CPU port(s) by forcing rx_pause and tx_pause in
b53_phylink_mac_link_up(). Preparatory step for getting rid of
b53_adjust_link().

Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com>
Reviewed-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Link: https://lore.kernel.org/r/20240423183339.1368511-5-florian.fainelli@broadcom.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/dsa/b53/b53_common.c

index a127a17be11c9f30f1b2033e4cf0b5d9ac9f5f32..6277ab7dcb7f172d0ba0b4ae2e63b69a27756a78 100644 (file)
@@ -1475,6 +1475,10 @@ static void b53_phylink_mac_link_up(struct dsa_switch *ds, int port,
                return;
 
        if (mode == MLO_AN_FIXED) {
+               /* Force flow control on BCM5301x's CPU port */
+               if (is5301x(dev) && dsa_is_cpu_port(ds, port))
+                       tx_pause = rx_pause = true;
+
                b53_force_port_config(dev, port, speed, duplex,
                                      tx_pause, rx_pause);
                b53_force_link(dev, port, true);