Message ID | 20191109130301.13716-10-olteanv@gmail.com |
---|---|
State | Accepted |
Delegated to: | David Miller |
Headers | show |
Series | Accomodate DSA front-end into Ocelot | expand |
On Sat, Nov 09, 2019 at 03:02:55PM +0200, Vladimir Oltean wrote: > From: Vladimir Oltean <vladimir.oltean@nxp.com> > > The VSC7514 switch (Ocelot) is a 10-port device, while VSC9959 (Felix) > is 6-port. Therefore the VLAN filtering mask would be out of bounds when > calling for this new switch. Fix that. Hi Vladimir Is this a real fix? Should it be posted to net? Thanks Andrew
On Sun, 10 Nov 2019 at 18:26, Andrew Lunn <andrew@lunn.ch> wrote: > > On Sat, Nov 09, 2019 at 03:02:55PM +0200, Vladimir Oltean wrote: > > From: Vladimir Oltean <vladimir.oltean@nxp.com> > > > > The VSC7514 switch (Ocelot) is a 10-port device, while VSC9959 (Felix) > > is 6-port. Therefore the VLAN filtering mask would be out of bounds when > > calling for this new switch. Fix that. > > Hi Vladimir > > Is this a real fix? Should it be posted to net? > > Thanks > Andrew Hi Andrew, Felix is not supported by the mainline ocelot driver yet, so there's no bug per se: ocelot->num_phys_ports can only be 10 at the moment. Thanks, -Vladimir
diff --git a/drivers/net/ethernet/mscc/ocelot.c b/drivers/net/ethernet/mscc/ocelot.c index 58ead0652bce..107a07cfaec9 100644 --- a/drivers/net/ethernet/mscc/ocelot.c +++ b/drivers/net/ethernet/mscc/ocelot.c @@ -389,7 +389,8 @@ static void ocelot_vlan_init(struct ocelot *ocelot) /* Set vlan ingress filter mask to all ports but the CPU port by * default. */ - ocelot_write(ocelot, GENMASK(9, 0), ANA_VLANMASK); + ocelot_write(ocelot, GENMASK(ocelot->num_phys_ports - 1, 0), + ANA_VLANMASK); for (port = 0; port < ocelot->num_phys_ports; port++) { ocelot_write_gix(ocelot, 0, REW_PORT_VLAN_CFG, port);