Skip to content

Commit 764a47a

Browse files
author
Paolo Abeni
committed
Merge branch 'lantiq_gswip-fixes'
Vladimir Oltean says: ==================== lantiq_gswip fixes This is a small set of fixes which I believe should be backported for the lantiq_gswip driver. Daniel Golle asked me to submit them here: https://lore.kernel.org/netdev/aLiDfrXUbw1O5Vdi@pidgin.makrotopia.org/ As mentioned there, a merge conflict with net-next is expected, due to the movement of the driver to the 'drivers/net/dsa/lantiq' folder there. Good luck :-/ Patch 2/2 fixes an old regression and is the minimal fix for that, as discussed here: https://lore.kernel.org/netdev/aJfNMLNoi1VOsPrN@pidgin.makrotopia.org/ Patch 1/2 was identified by me through static analysis, and I consider it to be a serious deficiency. It needs a test tag. ==================== Link: https://patch.msgid.link/20250918072142.894692-1-vladimir.oltean@nxp.com Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2 parents b7e32ae + 987afe1 commit 764a47a

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

drivers/net/dsa/lantiq_gswip.c

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -685,18 +685,27 @@ static int gswip_add_single_port_br(struct gswip_priv *priv, int port, bool add)
685685
return 0;
686686
}
687687

688-
static int gswip_port_enable(struct dsa_switch *ds, int port,
689-
struct phy_device *phydev)
688+
static int gswip_port_setup(struct dsa_switch *ds, int port)
690689
{
691690
struct gswip_priv *priv = ds->priv;
692691
int err;
693692

694693
if (!dsa_is_cpu_port(ds, port)) {
695-
u32 mdio_phy = 0;
696-
697694
err = gswip_add_single_port_br(priv, port, true);
698695
if (err)
699696
return err;
697+
}
698+
699+
return 0;
700+
}
701+
702+
static int gswip_port_enable(struct dsa_switch *ds, int port,
703+
struct phy_device *phydev)
704+
{
705+
struct gswip_priv *priv = ds->priv;
706+
707+
if (!dsa_is_cpu_port(ds, port)) {
708+
u32 mdio_phy = 0;
700709

701710
if (phydev)
702711
mdio_phy = phydev->mdio.addr & GSWIP_MDIO_PHY_ADDR_MASK;
@@ -1359,8 +1368,9 @@ static int gswip_port_fdb(struct dsa_switch *ds, int port,
13591368
int i;
13601369
int err;
13611370

1371+
/* Operation not supported on the CPU port, don't throw errors */
13621372
if (!bridge)
1363-
return -EINVAL;
1373+
return 0;
13641374

13651375
for (i = max_ports; i < ARRAY_SIZE(priv->vlans); i++) {
13661376
if (priv->vlans[i].bridge == bridge) {
@@ -1829,6 +1839,7 @@ static const struct phylink_mac_ops gswip_phylink_mac_ops = {
18291839
static const struct dsa_switch_ops gswip_xrx200_switch_ops = {
18301840
.get_tag_protocol = gswip_get_tag_protocol,
18311841
.setup = gswip_setup,
1842+
.port_setup = gswip_port_setup,
18321843
.port_enable = gswip_port_enable,
18331844
.port_disable = gswip_port_disable,
18341845
.port_bridge_join = gswip_port_bridge_join,

0 commit comments

Comments
 (0)