[][kernel][mt7981][eth][Refactor issue of GMAC RX hanging when PHYs operates in half-duplex mode]
[Description]
Fix issue of GMAC RX hanging when PHYs operates in half-duplex mode.
In the previous update, we enabled PRMBL_LMT to filter out irregular
short packets when the internal GPHY PHY is connected to the legacy
10Mbps hub. However, we are facing a similar issue with the SGMII
PHY(EN8801S). As a result, we will also enable PRMBL_LMT function
in this scenario.
Without this patch, the GMAC RX direction might be stalled due to
irregular short packets.
[Release-log]
N/A
Change-Id: I2490e2945cafcdddc918ad217aabddbf4d191107
Reviewed-on: https://gerrit.mediatek.inc/c/openwrt/feeds/mtk_openwrt_feeds/+/9211393
diff --git a/21.02/files/target/linux/mediatek/files-5.4/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/21.02/files/target/linux/mediatek/files-5.4/drivers/net/ethernet/mediatek/mtk_eth_soc.c
index 5804f35..adde4eb 100644
--- a/21.02/files/target/linux/mediatek/files-5.4/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/21.02/files/target/linux/mediatek/files-5.4/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -1118,7 +1118,7 @@
mcr = mcr_cur;
mcr &= ~(MAC_MCR_SPEED_100 | MAC_MCR_SPEED_1000 |
MAC_MCR_FORCE_DPX | MAC_MCR_FORCE_TX_FC |
- MAC_MCR_FORCE_RX_FC);
+ MAC_MCR_FORCE_RX_FC | MAC_MCR_PRMBL_LMT_EN);
mcr |= MAC_MCR_MAX_RX_1536 | MAC_MCR_IPG_CFG | MAC_MCR_FORCE_MODE |
MAC_MCR_BACKOFF_EN | MAC_MCR_BACKPR_EN | MAC_MCR_FORCE_LINK;
@@ -1135,8 +1135,7 @@
/* Configure duplex */
mcr |= MAC_MCR_FORCE_DPX;
- if (duplex == DUPLEX_HALF &&
- interface == PHY_INTERFACE_MODE_GMII)
+ if (duplex == DUPLEX_HALF)
mcr |= MAC_MCR_PRMBL_LMT_EN;
/* Configure pause modes -