]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
net: dsa: b53: fix VLAN ID for untagged vlan on bridge leave
authorJonas Gorski <jonas.gorski@gmail.com>
Tue, 29 Apr 2025 20:17:04 +0000 (22:17 +0200)
committerJakub Kicinski <kuba@kernel.org>
Thu, 8 May 2025 02:30:34 +0000 (19:30 -0700)
The untagged default VLAN is added to the default vlan, which may be
one, but we modify the VLAN 0 entry on bridge leave.

Fix this to use the correct VLAN entry for the default pvid.

Fixes: fea83353177a ("net: dsa: b53: Fix default VLAN ID")
Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
Tested-by: Florian Fainelli <florian.fainelli@broadcom.com>
Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
Link: https://patch.msgid.link/20250429201710.330937-6-jonas.gorski@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/dsa/b53/b53_common.c

index c67c0b5fbc1bec28c12c645719a2e4afcc9f5d3f..c60b552b945cee39e105703e708cd2a02390ed66 100644 (file)
@@ -1986,7 +1986,7 @@ EXPORT_SYMBOL(b53_br_join);
 void b53_br_leave(struct dsa_switch *ds, int port, struct dsa_bridge bridge)
 {
        struct b53_device *dev = ds->priv;
-       struct b53_vlan *vl = &dev->vlans[0];
+       struct b53_vlan *vl;
        s8 cpu_port = dsa_to_port(ds, port)->cpu_dp->index;
        unsigned int i;
        u16 pvlan, reg, pvid;
@@ -2012,6 +2012,7 @@ void b53_br_leave(struct dsa_switch *ds, int port, struct dsa_bridge bridge)
        dev->ports[port].vlan_ctl_mask = pvlan;
 
        pvid = b53_default_pvid(dev);
+       vl = &dev->vlans[pvid];
 
        /* Make this port join all VLANs without VLAN entries */
        if (is58xx(dev)) {