Skip to contentSkip to conversation

net: ethernet: mtk_eth_soc: disable hardware DSA untagging for second MAC

PATCH Applied [email protected] 4 participants 4 messages Jan 28, 2023 – Feb 2, 2023

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: ethernet: mtk_eth_soc: disable hardware DSA untagging for second MAC

From: Arınç ÜNAL <[email protected]>

According to my tests on MT7621AT and MT7623NI SoCs, hardware DSA untagging won't work on the second MAC. Therefore, disable this feature when the second MAC of the MT7621 and MT7623 SoCs is being used.

Fixes 2d7605a72906 ("net: ethernet: mtk_eth_soc: enable hardware DSA untagging")

---

Final send which should end up on the list. I tested this with Felix's upcoming patch series. This fix is still needed on top of it.

https://lore.kernel.org/netdev/[email protected]/

The MTK_GMAC1_TRGMII capability is only on the MT7621 and MT7623 SoCs which I see this problem on. I'm new to coding so I took an educated guess from the use of MTK_NETSYS_V2 to disable this feature altogether for MT7986 SoC.

Arınç

---
 drivers/net/ethernet/mediatek/mtk_eth_soc.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/net/ethernet/mediatek/mtk_eth_soc.c +4 -2
index 801deac58bf7..f1cb1efc94cf 100644
@@ -3243,7 +3243,8 @@ static int mtk_open(struct net_device *dev)
 	struct mtk_eth *eth = mac->hw;
 	int i, err;
 
-	if (mtk_uses_dsa(dev) && !eth->prog) {
+	if ((mtk_uses_dsa(dev) && !eth->prog) &&
+	    !(mac->id == 1 && MTK_HAS_CAPS(eth->soc->caps, MTK_GMAC1_TRGMII))) {
 		for (i = 0; i < ARRAY_SIZE(eth->dsa_meta); i++) {
 			struct metadata_dst *md_dst = eth->dsa_meta[i];
 
@@ -3260,7 +3261,8 @@ static int mtk_open(struct net_device *dev)
 		}
 	} else {
 		/* Hardware special tag parsing needs to be disabled if at least
-		 * one MAC does not use DSA.
+		 * one MAC does not use DSA, or the second MAC of the MT7621 and
+		 * MT7623 SoCs is being used.
 		 */
 		u32 val = mtk_r32(eth, MTK_CDMP_IG_CTRL);
 		val &= ~MTK_CDMP_STAG_EN;
Signature · 1 line
2.37.2
maintainer
#1 lore raw
Quoted 12 lines · On Sat, 2023-01-28 at 12:42 +0300, [email protected] wrote:

From: Arınç ÜNAL <[email protected]>

According to my tests on MT7621AT and MT7623NI SoCs, hardware DSA untagging won't work on the second MAC. Therefore, disable this feature when the second MAC of the MT7621 and MT7623 SoCs is being used.

Fixes 2d7605a72906 ("net: ethernet: mtk_eth_soc: enable hardware DSA untagging")

---

Quoted 8 lines

Final send which should end up on the list. I tested this with Felix's upcoming patch series. This fix is still needed on top of it.

https://lore.kernel.org/netdev/[email protected]/

The MTK_GMAC1_TRGMII capability is only on the MT7621 and MT7623 SoCs which I see this problem on. I'm new to coding so I took an educated guess from the use of MTK_NETSYS_V2 to disable this feature altogether for MT7986 SoC.

Keeping this one a little more on pw. It would be great is someone else could validate the above on the relevant H/W.

Thanks,

Paolo

#2 lore raw
Quoted 16 lines · Paolo Abeni
Quoted 15 lines · On Sat, 2023-01-28 at 12:42 +0300, [email protected] wrote:

From: Arınç ÜNAL <[email protected]>

According to my tests on MT7621AT and MT7623NI SoCs, hardware DSA untagging won't work on the second MAC. Therefore, disable this feature when the second MAC of the MT7621 and MT7623 SoCs is being used.

Fixes 2d7605a72906 ("net: ethernet: mtk_eth_soc: enable hardware DSA untagging")

---

Final send which should end up on the list. I tested this with Felix's upcoming patch series. This fix is still needed on top of it.

Quoted 8 lines
Quoted 5 lines

https://lore.kernel.org/netdev/[email protected]/

The MTK_GMAC1_TRGMII capability is only on the MT7621 and MT7623 SoCs which I see this problem on. I'm new to coding so I took an educated guess from the use of MTK_NETSYS_V2 to disable this feature altogether for MT7986 SoC.

Keeping this one a little more on pw. It would be great is someone else could validate the above on the relevant H/W.

CC'ing Frank. Frank, could you test this on your Bananapi BPI-R2?

Arınç

#3 lore raw
In reply to [email protected]
This patch was applied to netdev/net.git (master) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net.git (master)
by Jakub Kicinski <[email protected]>:

Quoted 6 lines · On Sat, 28 Jan 2023 12:42:32 +0300 you wrote:

From: Arınç ÜNAL <[email protected]>

According to my tests on MT7621AT and MT7623NI SoCs, hardware DSA untagging won't work on the second MAC. Therefore, disable this feature when the second MAC of the MT7621 and MT7623 SoCs is being used.

Quoted 6 lines
Fixes 2d7605a72906 ("net: ethernet: mtk_eth_soc: enable hardware DSA untagging")

[...]

Here is the summary with links:
- [net] net: ethernet: mtk_eth_soc: disable hardware DSA untagging for second MAC

    https://git.kernel.org/netdev/net/c/a1f47752fd62

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html