Skip to content

Commit b2025c7

Browse files
moore-brosdavem330
authored andcommitted
net: ethernet: mediatek: fix flow control settings on GMAC0 is not being enabled properly
Commit 08ef55c ("net-next: mediatek: fix gigabit and flow control advertisement") had supported proper flow control settings for GMAC1. But for GMAC0, 1.GMAC0 shares the common logic with GMAC1 inside mtk_phy_link_adjust() to adapt various settings for the target phy. 2.GMAC0 uses fixed-phy to connect to a builtin gigabit switch with fixed link speed as commit 0c72c50 ("net-next: mediatek: add fixed-phy support") describes. 3.However, fixed-phy doesn't enable SUPPORTED_Pause & SUPPORTED_Asym_Pause supported flag on default that would cause mtk_phy_link_adjust() not to enable flow control setting on GMAC0 properly and cause packet dropped when high traffic. Due to these reasons, the patch adds SUPPORTED_Pause & SUPPORTED_Asym_Pause supported flags on fixed-phy used by the driver to have proper handling on the both GMAC with the shared common logic. Signed-off-by: Sean Wang <sean.wang@mediatek.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 8ca7f4f commit b2025c7

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

drivers/net/ethernet/mediatek/mtk_eth_soc.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,11 @@ static int mtk_phy_connect(struct mtk_mac *mac)
267267
mac->phy_dev->autoneg = AUTONEG_ENABLE;
268268
mac->phy_dev->speed = 0;
269269
mac->phy_dev->duplex = 0;
270+
271+
if (of_phy_is_fixed_link(mac->of_node))
272+
mac->phy_dev->supported |=
273+
SUPPORTED_Pause | SUPPORTED_Asym_Pause;
274+
270275
mac->phy_dev->supported &= PHY_GBIT_FEATURES | SUPPORTED_Pause |
271276
SUPPORTED_Asym_Pause;
272277
mac->phy_dev->advertising = mac->phy_dev->supported |

0 commit comments

Comments
 (0)