Skip to content

Commit 21386e6

Browse files
arinc9davem330
authored andcommitted
net: ethernet: mtk_eth_soc: enable special tag when any MAC uses DSA
The special tag is only enabled when the first MAC uses DSA. However, it must be enabled when any MAC uses DSA. Change the check accordingly. This fixes hardware DSA untagging not working on the second MAC of the MT7621 and MT7623 SoCs, and likely other SoCs too. Therefore, remove the check that disables hardware DSA untagging for the second MAC of the MT7621 and MT7623 SoCs. Fixes: a1f4775 ("net: ethernet: mtk_eth_soc: disable hardware DSA untagging for second MAC") Co-developed-by: Richard van Schagen <[email protected]> Signed-off-by: Richard van Schagen <[email protected]> Signed-off-by: Arınç ÜNAL <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 9cec2aa commit 21386e6

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

drivers/net/ethernet/mediatek/mtk_eth_soc.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3111,7 +3111,7 @@ static void mtk_gdm_config(struct mtk_eth *eth, u32 config)
31113111

31123112
val |= config;
31133113

3114-
if (!i && eth->netdev[0] && netdev_uses_dsa(eth->netdev[0]))
3114+
if (eth->netdev[i] && netdev_uses_dsa(eth->netdev[i]))
31153115
val |= MTK_GDMA_SPECIAL_TAG;
31163116

31173117
mtk_w32(eth, val, MTK_GDMA_FWD_CFG(i));
@@ -3177,8 +3177,7 @@ static int mtk_open(struct net_device *dev)
31773177
struct mtk_eth *eth = mac->hw;
31783178
int i, err;
31793179

3180-
if ((mtk_uses_dsa(dev) && !eth->prog) &&
3181-
!(mac->id == 1 && MTK_HAS_CAPS(eth->soc->caps, MTK_GMAC1_TRGMII))) {
3180+
if (mtk_uses_dsa(dev) && !eth->prog) {
31823181
for (i = 0; i < ARRAY_SIZE(eth->dsa_meta); i++) {
31833182
struct metadata_dst *md_dst = eth->dsa_meta[i];
31843183

@@ -3195,8 +3194,7 @@ static int mtk_open(struct net_device *dev)
31953194
}
31963195
} else {
31973196
/* Hardware special tag parsing needs to be disabled if at least
3198-
* one MAC does not use DSA, or the second MAC of the MT7621 and
3199-
* MT7623 SoCs is being used.
3197+
* one MAC does not use DSA.
32003198
*/
32013199
u32 val = mtk_r32(eth, MTK_CDMP_IG_CTRL);
32023200
val &= ~MTK_CDMP_STAG_EN;

0 commit comments

Comments
 (0)