Skip to content

Commit c499696

Browse files
ffainellidavem330
authored andcommitted
net: dsa: b53: Stop using dev->cpu_port incorrectly
dev->cpu_port is the driver local information that should only be used to look up register offsets for a particular port, when they differ (e.g: IMP port override), but it should certainly not be used in place of the DSA configured CPU port. Since the DSA switch layer calls port_vlan_{add,del}() on the CPU port as well, we can remove the specific setting of the CPU port within port_vlan_{add,del}. Fixes: ff39c2d ("net: dsa: b53: Add bridge support") Fixes: 967dd82 ("net: dsa: b53: Add support for Broadcom RoboSwitch") Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 4d215ae commit c499696

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

drivers/net/dsa/b53/b53_common.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,7 @@ EXPORT_SYMBOL(b53_imp_vlan_setup);
505505
int b53_enable_port(struct dsa_switch *ds, int port, struct phy_device *phy)
506506
{
507507
struct b53_device *dev = ds->priv;
508-
unsigned int cpu_port = dev->cpu_port;
508+
unsigned int cpu_port = ds->ports[port].cpu_dp->index;
509509
u16 pvlan;
510510

511511
/* Clear the Rx and Tx disable bits and set to no spanning tree */
@@ -1054,7 +1054,6 @@ void b53_vlan_add(struct dsa_switch *ds, int port,
10541054
struct b53_device *dev = ds->priv;
10551055
bool untagged = vlan->flags & BRIDGE_VLAN_INFO_UNTAGGED;
10561056
bool pvid = vlan->flags & BRIDGE_VLAN_INFO_PVID;
1057-
unsigned int cpu_port = dev->cpu_port;
10581057
struct b53_vlan *vl;
10591058
u16 vid;
10601059

@@ -1063,12 +1062,11 @@ void b53_vlan_add(struct dsa_switch *ds, int port,
10631062

10641063
b53_get_vlan_entry(dev, vid, vl);
10651064

1066-
vl->members |= BIT(port) | BIT(cpu_port);
1065+
vl->members |= BIT(port);
10671066
if (untagged)
10681067
vl->untag |= BIT(port);
10691068
else
10701069
vl->untag &= ~BIT(port);
1071-
vl->untag &= ~BIT(cpu_port);
10721070

10731071
b53_set_vlan_entry(dev, vid, vl);
10741072
b53_fast_age_vlan(dev, vid);
@@ -1432,8 +1430,8 @@ void b53_br_leave(struct dsa_switch *ds, int port, struct net_device *br)
14321430
b53_write16(dev, B53_VLAN_PAGE, B53_JOIN_ALL_VLAN_EN, reg);
14331431
} else {
14341432
b53_get_vlan_entry(dev, pvid, vl);
1435-
vl->members |= BIT(port) | BIT(dev->cpu_port);
1436-
vl->untag |= BIT(port) | BIT(dev->cpu_port);
1433+
vl->members |= BIT(port) | BIT(cpu_port);
1434+
vl->untag |= BIT(port) | BIT(cpu_port);
14371435
b53_set_vlan_entry(dev, pvid, vl);
14381436
}
14391437
}

0 commit comments

Comments
 (0)