From d4884c0bc503bfdecd49abd8c1d31b80c5b8cdcb Mon Sep 17 00:00:00 2001 From: Denis Kirjanov Date: May 16 2023 11:55:49 +0000 Subject: net: mediatek: setup proper state for disabled GMAC on the default (git-fixes). --- diff --git a/patches.suse/net-mediatek-setup-proper-state-for-disabled-GMAC-on.patch b/patches.suse/net-mediatek-setup-proper-state-for-disabled-GMAC-on.patch new file mode 100644 index 0000000..9b01e22 --- /dev/null +++ b/patches.suse/net-mediatek-setup-proper-state-for-disabled-GMAC-on.patch @@ -0,0 +1,49 @@ +From fbd281229913d52b2d58703af4cf85e5f41da508 Mon Sep 17 00:00:00 2001 +From: Sean Wang +Date: Mon, 18 Dec 2017 17:00:17 +0800 +Subject: [PATCH 1/8] net: mediatek: setup proper state for disabled GMAC on + the default +References: git-fixes +Patch-mainline: v4.15-rc5 +Git-commit: 7352e252b5bf40d59342494a70354a2d436fd0cd + +The current solution would setup fixed and force link of 1Gbps to the both +GMAC on the default. However, The GMAC should always be put to link down +state when the GMAC is disabled on certain target boards. Otherwise, +the driver possibly receives unexpected data from the floating hardware +connection through the unused GMAC. Although the driver had been added +certain protection in RX path to get rid of such kind of unexpected data +sent to the upper stack. + +Signed-off-by: Sean Wang +Signed-off-by: David S. Miller +Signed-off-by: Denis Kirjanov +--- + drivers/net/ethernet/mediatek/mtk_eth_soc.c | 11 ++++++----- + 1 file changed, 6 insertions(+), 5 deletions(-) + +diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c +index 5f15eb86ff00..29142c793c58 100644 +--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c ++++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c +@@ -1850,11 +1850,12 @@ static int mtk_hw_init(struct mtk_eth *eth) + /* set GE2 TUNE */ + regmap_write(eth->pctl, GPIO_BIAS_CTRL, 0x0); + +- /* GE1, Force 1000M/FD, FC ON */ +- mtk_w32(eth, MAC_MCR_FIXED_LINK, MTK_MAC_MCR(0)); +- +- /* GE2, Force 1000M/FD, FC ON */ +- mtk_w32(eth, MAC_MCR_FIXED_LINK, MTK_MAC_MCR(1)); ++ /* Set linkdown as the default for each GMAC. Its own MCR would be set ++ * up with the more appropriate value when mtk_phy_link_adjust call is ++ * being invoked. ++ */ ++ for (i = 0; i < MTK_MAC_COUNT; i++) ++ mtk_w32(eth, 0, MTK_MAC_MCR(i)); + + /* Indicates CDM to parse the MTK special tag from CPU + * which also is working out for untag packets. +-- +2.16.4 + diff --git a/series.conf b/series.conf index 8604288..d710051 100644 --- a/series.conf +++ b/series.conf @@ -18880,6 +18880,7 @@ patches.suse/mac80211_hwsim-Fix-a-possible-sleep-in-atomic-bug-in patches.suse/tg3-Fix-rx-hang-on-MTU-change-with-5717-5719.patch patches.suse/mlxsw-spectrum_router-Remove-batch-neighbour-deletio.patch + patches.suse/net-mediatek-setup-proper-state-for-disabled-GMAC-on.patch patches.suse/vxlan-update-skb-dst-pmtu-on-tx-path.patch patches.suse/ip_gre-remove-the-incorrect-mtu-limit-for-ipgre-tap.patch patches.suse/ip6_gre-remove-the-incorrect-mtu-limit-for-ipgre-tap.patch