]> www.infradead.org Git - users/hch/configfs.git/commitdiff
net: dsa: vsc73xx: fix port MAC configuration in full duplex mode
authorPawel Dembicki <paweldembicki@gmail.com>
Fri, 9 Aug 2024 19:38:02 +0000 (21:38 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 12 Aug 2024 10:46:55 +0000 (11:46 +0100)
According to the datasheet description ("Port Mode Procedure" in 5.6.2),
the VSC73XX_MAC_CFG_WEXC_DIS bit is configured only for half duplex mode.

The WEXC_DIS bit is responsible for MAC behavior after an excessive
collision. Let's set it as described in the datasheet.

Fixes: 05bd97fc559d ("net: dsa: Add Vitesse VSC73xx DSA router driver")
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/dsa/vitesse-vsc73xx-core.c

index d9d3e30fd47ad4d357224be4024a7afe9940a795..f548ed4cb23f0c278d40b298353d7ffd1835c518 100644 (file)
@@ -957,6 +957,11 @@ static void vsc73xx_mac_link_up(struct phylink_config *config,
 
        if (duplex == DUPLEX_FULL)
                val |= VSC73XX_MAC_CFG_FDX;
+       else
+               /* In datasheet description ("Port Mode Procedure" in 5.6.2)
+                * this bit is configured only for half duplex.
+                */
+               val |= VSC73XX_MAC_CFG_WEXC_DIS;
 
        /* This routine is described in the datasheet (below ARBDISC register
         * description)
@@ -967,7 +972,6 @@ static void vsc73xx_mac_link_up(struct phylink_config *config,
        get_random_bytes(&seed, 1);
        val |= seed << VSC73XX_MAC_CFG_SEED_OFFSET;
        val |= VSC73XX_MAC_CFG_SEED_LOAD;
-       val |= VSC73XX_MAC_CFG_WEXC_DIS;
 
        /* Those bits are responsible for MTU only. Kernel takes care about MTU,
         * let's enable +8 bytes frame length unconditionally.