1 From: =?UTF-8?q?Ar=C4=B1n=C3=A7=20=C3=9CNAL?= <arinc.unal@arinc9.com>
2 Date: Sun, 5 Feb 2023 20:53:31 +0300
3 Subject: [PATCH] net: ethernet: mtk_eth_soc: enable special tag when any MAC
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
9 The special tag is only enabled when the first MAC uses DSA. However, it
10 must be enabled when any MAC uses DSA. Change the check accordingly.
12 This fixes hardware DSA untagging not working on the second MAC of the
13 MT7621 and MT7623 SoCs, and likely other SoCs too. Therefore, remove the
14 check that disables hardware DSA untagging for the second MAC of the MT7621
17 Fixes: a1f47752fd62 ("net: ethernet: mtk_eth_soc: disable hardware DSA untagging for second MAC")
18 Co-developed-by: Richard van Schagen <richard@routerhints.com>
19 Signed-off-by: Richard van Schagen <richard@routerhints.com>
20 Signed-off-by: Arınç ÜNAL <arinc.unal@arinc9.com>
21 Signed-off-by: David S. Miller <davem@davemloft.net>
24 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
25 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
26 @@ -3137,7 +3137,7 @@ static void mtk_gdm_config(struct mtk_et
30 - if (!i && eth->netdev[0] && netdev_uses_dsa(eth->netdev[0]))
31 + if (eth->netdev[i] && netdev_uses_dsa(eth->netdev[i]))
32 val |= MTK_GDMA_SPECIAL_TAG;
34 mtk_w32(eth, val, MTK_GDMA_FWD_CFG(i));
35 @@ -3202,8 +3202,7 @@ static int mtk_open(struct net_device *d
36 struct mtk_eth *eth = mac->hw;
39 - if ((mtk_uses_dsa(dev) && !eth->prog) &&
40 - !(mac->id == 1 && MTK_HAS_CAPS(eth->soc->caps, MTK_GMAC1_TRGMII))) {
41 + if (mtk_uses_dsa(dev) && !eth->prog) {
42 for (i = 0; i < ARRAY_SIZE(eth->dsa_meta); i++) {
43 struct metadata_dst *md_dst = eth->dsa_meta[i];
45 @@ -3220,8 +3219,7 @@ static int mtk_open(struct net_device *d
48 /* Hardware special tag parsing needs to be disabled if at least
49 - * one MAC does not use DSA, or the second MAC of the MT7621 and
50 - * MT7623 SoCs is being used.
51 + * one MAC does not use DSA.
53 u32 val = mtk_r32(eth, MTK_CDMP_IG_CTRL);
54 val &= ~MTK_CDMP_STAG_EN;