]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
net: dsa: b53: fix enabling ip multicast
authorJonas Gorski <jonas.gorski@gmail.com>
Sun, 2 Nov 2025 10:07:56 +0000 (11:07 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 3 Dec 2025 11:45:15 +0000 (12:45 +0100)
[ Upstream commit c264294624e956a967a9e2e5fa41e3273340b089 ]

In the New Control register bit 1 is either reserved, or has a different
function:

    Out of Range Error Discard

    When enabled, the ingress port discards any frames
    if the Length field is between 1500 and 1536
    (excluding 1500 and 1536) and with good CRC.

The actual bit for enabling IP multicast is bit 0, which was only
explicitly enabled for BCM5325 so far.

For older switch chips, this bit defaults to 0, so we want to enable it
as well, while newer switch chips default to 1, and their documentation
says "It is illegal to set this bit to zero."

So drop the wrong B53_IPMC_FWD_EN define, enable the IP multicast bit
also for other switch chips. While at it, rename it to (B53_)IP_MC as
that is how it is called in Broadcom code.

Fixes: 63cc54a6f073 ("net: dsa: b53: Fix egress flooding settings")
Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
Link: https://patch.msgid.link/20251102100758.28352-2-jonas.gorski@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/dsa/b53/b53_common.c
drivers/net/dsa/b53/b53_regs.h

index 234ef7771ceef5a88ffa2ed44146ee9373502ed3..bc303b3e1c9663d67ea99573fd03d738ff9570cc 100644 (file)
@@ -347,11 +347,11 @@ static void b53_set_forwarding(struct b53_device *dev, int enable)
                 * frames should be flooded or not.
                 */
                b53_read8(dev, B53_CTRL_PAGE, B53_IP_MULTICAST_CTRL, &mgmt);
-               mgmt |= B53_UC_FWD_EN | B53_MC_FWD_EN | B53_IPMC_FWD_EN;
+               mgmt |= B53_UC_FWD_EN | B53_MC_FWD_EN | B53_IP_MC;
                b53_write8(dev, B53_CTRL_PAGE, B53_IP_MULTICAST_CTRL, mgmt);
        } else {
                b53_read8(dev, B53_CTRL_PAGE, B53_IP_MULTICAST_CTRL, &mgmt);
-               mgmt |= B53_IP_MCAST_25;
+               mgmt |= B53_IP_MC;
                b53_write8(dev, B53_CTRL_PAGE, B53_IP_MULTICAST_CTRL, mgmt);
        }
 }
index 77fb7ae660b8c8ddf3a13e6954e6dad19a00766e..95f70248c194df75de5f3b26bd2a1fb77a6c333d 100644 (file)
 
 /* IP Multicast control (8 bit) */
 #define B53_IP_MULTICAST_CTRL          0x21
-#define  B53_IP_MCAST_25               BIT(0)
-#define  B53_IPMC_FWD_EN               BIT(1)
+#define  B53_IP_MC                     BIT(0)
 #define  B53_UC_FWD_EN                 BIT(6)
 #define  B53_MC_FWD_EN                 BIT(7)