summaryrefslogtreecommitdiffstats
path: root/target/linux/generic/backport-5.15/730-13-v6.3-net-ethernet-mtk_eth_soc-enable-special-tag-when-any.patch
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@nbd.name>2023-03-04 19:11:37 +0100
committerFelix Fietkau <nbd@nbd.name>2023-03-05 08:51:22 +0100
commitdaaf708b8c433cfedc7860eab30a9e585490b3c6 (patch)
treed885a4ee7dea6d35502ae0f4cc2fed1c251abe77 /target/linux/generic/backport-5.15/730-13-v6.3-net-ethernet-mtk_eth_soc-enable-special-tag-when-any.patch
parent5ef783c1b26bef0b6cdbf44401ff6fb487e4d2f5 (diff)
downloadopenwrt-daaf708b8c433cfedc7860eab30a9e585490b3c6.tar.gz
openwrt-daaf708b8c433cfedc7860eab30a9e585490b3c6.tar.bz2
openwrt-daaf708b8c433cfedc7860eab30a9e585490b3c6.zip
kernel: backport upstream mtk_eth_soc fixes
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'target/linux/generic/backport-5.15/730-13-v6.3-net-ethernet-mtk_eth_soc-enable-special-tag-when-any.patch')
-rw-r--r--target/linux/generic/backport-5.15/730-13-v6.3-net-ethernet-mtk_eth_soc-enable-special-tag-when-any.patch54
1 files changed, 54 insertions, 0 deletions
diff --git a/target/linux/generic/backport-5.15/730-13-v6.3-net-ethernet-mtk_eth_soc-enable-special-tag-when-any.patch b/target/linux/generic/backport-5.15/730-13-v6.3-net-ethernet-mtk_eth_soc-enable-special-tag-when-any.patch
new file mode 100644
index 0000000000..14abdcd876
--- /dev/null
+++ b/target/linux/generic/backport-5.15/730-13-v6.3-net-ethernet-mtk_eth_soc-enable-special-tag-when-any.patch
@@ -0,0 +1,54 @@
+From: =?UTF-8?q?Ar=C4=B1n=C3=A7=20=C3=9CNAL?= <arinc.unal@arinc9.com>
+Date: Sun, 5 Feb 2023 20:53:31 +0300
+Subject: [PATCH] net: ethernet: mtk_eth_soc: enable special tag when any MAC
+ uses DSA
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+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: a1f47752fd62 ("net: ethernet: mtk_eth_soc: disable hardware DSA untagging for second MAC")
+Co-developed-by: Richard van Schagen <richard@routerhints.com>
+Signed-off-by: Richard van Schagen <richard@routerhints.com>
+Signed-off-by: Arınç ÜNAL <arinc.unal@arinc9.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+---
+
+--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
++++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+@@ -3077,7 +3077,7 @@ static void mtk_gdm_config(struct mtk_et
+
+ val |= config;
+
+- if (!i && eth->netdev[0] && netdev_uses_dsa(eth->netdev[0]))
++ if (eth->netdev[i] && netdev_uses_dsa(eth->netdev[i]))
+ val |= MTK_GDMA_SPECIAL_TAG;
+
+ mtk_w32(eth, val, MTK_GDMA_FWD_CFG(i));
+@@ -3142,8 +3142,7 @@ static int mtk_open(struct net_device *d
+ struct mtk_eth *eth = mac->hw;
+ int i, err;
+
+- if ((mtk_uses_dsa(dev) && !eth->prog) &&
+- !(mac->id == 1 && MTK_HAS_CAPS(eth->soc->caps, MTK_GMAC1_TRGMII))) {
++ if (mtk_uses_dsa(dev) && !eth->prog) {
+ for (i = 0; i < ARRAY_SIZE(eth->dsa_meta); i++) {
+ struct metadata_dst *md_dst = eth->dsa_meta[i];
+
+@@ -3160,8 +3159,7 @@ static int mtk_open(struct net_device *d
+ }
+ } else {
+ /* Hardware special tag parsing needs to be disabled if at least
+- * one MAC does not use DSA, or the second MAC of the MT7621 and
+- * MT7623 SoCs is being used.
++ * one MAC does not use DSA.
+ */
+ u32 val = mtk_r32(eth, MTK_CDMP_IG_CTRL);
+ val &= ~MTK_CDMP_STAG_EN;