Skip to contentSkip to conversation

net: mvneta: fix use of state->speed

PATCH In review Russell King 2 participants 2 messages Jun 30, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: mvneta: fix use of state->speed

When support for short preambles was added, it incorrectly keyed its decision off state->speed instead of state->interface. state->speed is not guaranteed to be correct for in-band modes, which can lead to short preambles being unexpectedly disabled.

Fix this by keying off the interface mode, which is the only way that mvneta can operate at 2.5Gbps.

Fixes da58a931f248 ("net: mvneta: Add support for 2500Mbps SGMII")
---
 drivers/net/ethernet/marvell/mvneta.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/marvell/mvneta.c +1 -1
index c639e3a29302..7d5d9d34f4e4 100644
@@ -3959,7 +3959,7 @@ static void mvneta_mac_config(struct phylink_config *config, unsigned int mode,
 	/* When at 2.5G, the link partner can send frames with shortened
 	 * preambles.
 	 */
-	if (state->speed == SPEED_2500)
+	if (state->interface == PHY_INTERFACE_MODE_2500BASEX)
 		new_ctrl4 |= MVNETA_GMAC4_SHORT_PREAMBLE_ENABLE;
 
 	if (pp->phy_interface != state->interface) {
Signature · 1 line
2.20.1
maintainer
#1 lore raw

From: Russell King <[email protected]>
Date: Tue, 30 Jun 2020 11:04:40 +0100

Quoted 10 lines

When support for short preambles was added, it incorrectly keyed its decision off state->speed instead of state->interface. state->speed is not guaranteed to be correct for in-band modes, which can lead to short preambles being unexpectedly disabled.

Fix this by keying off the interface mode, which is the only way that mvneta can operate at 2.5Gbps.

Fixes da58a931f248 ("net: mvneta: Add support for 2500Mbps SGMII")

Applied and queued up for -stable, thanks.