linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] net: ethernet: mtk_eth_soc: disable hardware DSA untagging for second MAC
@ 2023-01-28  9:42 arinc9.unal
  2023-01-31 13:00 ` Paolo Abeni
  2023-02-02 19:40 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 4+ messages in thread
From: arinc9.unal @ 2023-01-28  9:42 UTC (permalink / raw)
  To: Felix Fietkau, John Crispin, Sean Wang, Mark Lee,
	Lorenzo Bianconi, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Matthias Brugger
  Cc: Arınç ÜNAL, netdev, linux-arm-kernel,
	linux-mediatek, linux-kernel, erkin.bozoglu

From: Arınç ÜNAL <arinc.unal@arinc9.com>

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")
Link: https://lore.kernel.org/netdev/6249fc14-b38a-c770-36b4-5af6d41c21d3@arinc9.com/
Tested-by: Arınç ÜNAL <arinc.unal@arinc9.com>
Signed-off-by: Arınç ÜNAL <arinc.unal@arinc9.com>
---

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/20221230073145.53386-1-nbd@nbd.name/

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(-)

diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
index 801deac58bf7..f1cb1efc94cf 100644
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -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;
-- 
2.37.2


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH net] net: ethernet: mtk_eth_soc: disable hardware DSA untagging for second MAC
  2023-01-28  9:42 [PATCH net] net: ethernet: mtk_eth_soc: disable hardware DSA untagging for second MAC arinc9.unal
@ 2023-01-31 13:00 ` Paolo Abeni
  2023-02-01 17:57   ` Arınç ÜNAL
  2023-02-02 19:40 ` patchwork-bot+netdevbpf
  1 sibling, 1 reply; 4+ messages in thread
From: Paolo Abeni @ 2023-01-31 13:00 UTC (permalink / raw)
  To: arinc9.unal, Felix Fietkau, John Crispin, Sean Wang, Mark Lee,
	Lorenzo Bianconi, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Matthias Brugger
  Cc: Arınç ÜNAL, netdev, linux-arm-kernel,
	linux-mediatek, linux-kernel, erkin.bozoglu

On Sat, 2023-01-28 at 12:42 +0300, arinc9.unal@gmail.com wrote:
> From: Arınç ÜNAL <arinc.unal@arinc9.com>
> 
> 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")
> Link: https://lore.kernel.org/netdev/6249fc14-b38a-c770-36b4-5af6d41c21d3@arinc9.com/
> Tested-by: Arınç ÜNAL <arinc.unal@arinc9.com>
> Signed-off-by: Arınç ÜNAL <arinc.unal@arinc9.com>
> ---
> 
> 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/20221230073145.53386-1-nbd@nbd.name/
> 
> 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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net] net: ethernet: mtk_eth_soc: disable hardware DSA untagging for second MAC
  2023-01-31 13:00 ` Paolo Abeni
@ 2023-02-01 17:57   ` Arınç ÜNAL
  0 siblings, 0 replies; 4+ messages in thread
From: Arınç ÜNAL @ 2023-02-01 17:57 UTC (permalink / raw)
  To: Paolo Abeni, Felix Fietkau, John Crispin, Sean Wang, Mark Lee,
	Lorenzo Bianconi, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Matthias Brugger
  Cc: netdev, linux-arm-kernel, linux-mediatek, linux-kernel,
	erkin.bozoglu, Frank Wunderlich

On 31.01.2023 16:00, Paolo Abeni wrote:
> On Sat, 2023-01-28 at 12:42 +0300, arinc9.unal@gmail.com wrote:
>> From: Arınç ÜNAL <arinc.unal@arinc9.com>
>>
>> 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")
>> Link: https://lore.kernel.org/netdev/6249fc14-b38a-c770-36b4-5af6d41c21d3@arinc9.com/
>> Tested-by: Arınç ÜNAL <arinc.unal@arinc9.com>
>> Signed-off-by: Arınç ÜNAL <arinc.unal@arinc9.com>
>> ---
>>
>> 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/20221230073145.53386-1-nbd@nbd.name/
>>
>> 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ç

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net] net: ethernet: mtk_eth_soc: disable hardware DSA untagging for second MAC
  2023-01-28  9:42 [PATCH net] net: ethernet: mtk_eth_soc: disable hardware DSA untagging for second MAC arinc9.unal
  2023-01-31 13:00 ` Paolo Abeni
@ 2023-02-02 19:40 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-02-02 19:40 UTC (permalink / raw)
  To: None
  Cc: nbd, john, sean.wang, Mark-MC.Lee, lorenzo, davem, edumazet,
	kuba, pabeni, matthias.bgg, arinc.unal, netdev, linux-arm-kernel,
	linux-mediatek, linux-kernel, erkin.bozoglu

Hello:

This patch was applied to netdev/net.git (master)
by Jakub Kicinski <kuba@kernel.org>:

On Sat, 28 Jan 2023 12:42:32 +0300 you wrote:
> From: Arınç ÜNAL <arinc.unal@arinc9.com>
> 
> 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")
> Link: https://lore.kernel.org/netdev/6249fc14-b38a-c770-36b4-5af6d41c21d3@arinc9.com/
> Tested-by: Arınç ÜNAL <arinc.unal@arinc9.com>
> Signed-off-by: Arınç ÜNAL <arinc.unal@arinc9.com>
> 
> [...]

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!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-02-02 19:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-28  9:42 [PATCH net] net: ethernet: mtk_eth_soc: disable hardware DSA untagging for second MAC arinc9.unal
2023-01-31 13:00 ` Paolo Abeni
2023-02-01 17:57   ` Arınç ÜNAL
2023-02-02 19:40 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).