Skip to content

Commit b9010db

Browse files
sch-mgregkh
authored andcommitted
net: dsa: lantiq_gswip: do also enable or disable cpu port
[ Upstream commit 86b9ea6 ] Before commit 74be4ba ("net: dsa: do not enable or disable non user ports"), gswip_port_enable/disable() were also executed for the cpu port in gswip_setup() which disabled the cpu port during initialization. Let's restore this by removing the dsa_is_user_port checks. Also, let's clean up the gswip_port_enable() function so that we only have to check for the cpu port once. The operation reordering done here is safe. Signed-off-by: Martin Schiller <ms@dev.tdt.de> Acked-by: Hauke Mehrtens <hauke@hauke-m.de> Reviewed-by: Vladimir Oltean <olteanv@gmail.com> Link: https://lore.kernel.org/r/20240611135434.3180973-7-ms@dev.tdt.de Signed-off-by: Jakub Kicinski <kuba@kernel.org> Stable-dep-of: c0054b2 ("net: dsa: lantiq_gswip: move gswip_add_single_port_br() call to port_setup()") Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent cf2d597 commit b9010db

1 file changed

Lines changed: 8 additions & 16 deletions

File tree

drivers/net/dsa/lantiq_gswip.c

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -661,13 +661,18 @@ static int gswip_port_enable(struct dsa_switch *ds, int port,
661661
struct gswip_priv *priv = ds->priv;
662662
int err;
663663

664-
if (!dsa_is_user_port(ds, port))
665-
return 0;
666-
667664
if (!dsa_is_cpu_port(ds, port)) {
665+
u32 mdio_phy = 0;
666+
668667
err = gswip_add_single_port_br(priv, port, true);
669668
if (err)
670669
return err;
670+
671+
if (phydev)
672+
mdio_phy = phydev->mdio.addr & GSWIP_MDIO_PHY_ADDR_MASK;
673+
674+
gswip_mdio_mask(priv, GSWIP_MDIO_PHY_ADDR_MASK, mdio_phy,
675+
GSWIP_MDIO_PHYp(port));
671676
}
672677

673678
/* RMON Counter Enable for port */
@@ -680,26 +685,13 @@ static int gswip_port_enable(struct dsa_switch *ds, int port,
680685
gswip_switch_mask(priv, 0, GSWIP_SDMA_PCTRL_EN,
681686
GSWIP_SDMA_PCTRLp(port));
682687

683-
if (!dsa_is_cpu_port(ds, port)) {
684-
u32 mdio_phy = 0;
685-
686-
if (phydev)
687-
mdio_phy = phydev->mdio.addr & GSWIP_MDIO_PHY_ADDR_MASK;
688-
689-
gswip_mdio_mask(priv, GSWIP_MDIO_PHY_ADDR_MASK, mdio_phy,
690-
GSWIP_MDIO_PHYp(port));
691-
}
692-
693688
return 0;
694689
}
695690

696691
static void gswip_port_disable(struct dsa_switch *ds, int port)
697692
{
698693
struct gswip_priv *priv = ds->priv;
699694

700-
if (!dsa_is_user_port(ds, port))
701-
return;
702-
703695
gswip_switch_mask(priv, GSWIP_FDMA_PCTRL_EN, 0,
704696
GSWIP_FDMA_PCTRLp(port));
705697
gswip_switch_mask(priv, GSWIP_SDMA_PCTRL_EN, 0,

0 commit comments

Comments
 (0)