diff options
author | Arınç ÜNAL <arinc.unal@arinc9.com> | 2023-01-28 12:42:32 +0300 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2023-02-02 22:30:41 +0300 |
commit | a1f47752fd6275b2502fb075945022d6cf264855 (patch) | |
tree | 8e76d776d7aad5b7be9469ac9568100ba66644c9 | |
parent | 63b114042d8a9c02d9939889177c36dbdb17a588 (diff) | |
download | linux-a1f47752fd6275b2502fb075945022d6cf264855.tar.xz |
net: ethernet: mtk_eth_soc: disable hardware DSA untagging for second MAC
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>
Link: https://lore.kernel.org/r/20230128094232.2451947-1-arinc.unal@arinc9.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
-rw-r--r-- | drivers/net/ethernet/mediatek/mtk_eth_soc.c | 6 |
1 files 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 e3de9a53b2d9..d56eda6397a4 100644 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c @@ -3177,7 +3177,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]; @@ -3194,7 +3195,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; |