Skip to content

Commit fd6f24d

Browse files
committed
Merge branch 'qcom-emac-pause'
Timur Tabi says: ==================== net: qcom/emac: ensure that pause frames are enabled The qcom emac driver experiences significant packet loss (through frame check sequence errors) if flow control is not enabled and the phy is not configured to allow pause frames to pass through it. Therefore, we need to enable flow control and force the phy to pass pause frames. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2 parents cdb26d3 + df63022 commit fd6f24d

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

drivers/net/ethernet/qualcomm/emac/emac-mac.c

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -575,10 +575,11 @@ void emac_mac_start(struct emac_adapter *adpt)
575575

576576
mac |= TXEN | RXEN; /* enable RX/TX */
577577

578-
/* We don't have ethtool support yet, so force flow-control mode
579-
* to 'full' always.
580-
*/
581-
mac |= TXFC | RXFC;
578+
/* Configure MAC flow control to match the PHY's settings. */
579+
if (phydev->pause)
580+
mac |= RXFC;
581+
if (phydev->pause != phydev->asym_pause)
582+
mac |= TXFC;
582583

583584
/* setup link speed */
584585
mac &= ~SPEED_MASK;
@@ -1003,6 +1004,12 @@ int emac_mac_up(struct emac_adapter *adpt)
10031004
writel((u32)~DIS_INT, adpt->base + EMAC_INT_STATUS);
10041005
writel(adpt->irq.mask, adpt->base + EMAC_INT_MASK);
10051006

1007+
/* Enable pause frames. Without this feature, the EMAC has been shown
1008+
* to receive (and drop) frames with FCS errors at gigabit connections.
1009+
*/
1010+
adpt->phydev->supported |= SUPPORTED_Pause | SUPPORTED_Asym_Pause;
1011+
adpt->phydev->advertising |= SUPPORTED_Pause | SUPPORTED_Asym_Pause;
1012+
10061013
adpt->phydev->irq = PHY_IGNORE_INTERRUPT;
10071014
phy_start(adpt->phydev);
10081015

0 commit comments

Comments
 (0)