Skip to content

Commit f2ca673

Browse files
Russell Kingdavem330
authored andcommitted
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: da58a93 ("net: mvneta: Add support for 2500Mbps SGMII") Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent b9fcf0a commit f2ca673

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎drivers/net/ethernet/marvell/mvneta.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3959,7 +3959,7 @@ static void mvneta_mac_config(struct phylink_config *config, unsigned int mode,
39593959
/* When at 2.5G, the link partner can send frames with shortened
39603960
* preambles.
39613961
*/
3962-
if (state->speed == SPEED_2500)
3962+
if (state->interface == PHY_INTERFACE_MODE_2500BASEX)
39633963
new_ctrl4 |= MVNETA_GMAC4_SHORT_PREAMBLE_ENABLE;
39643964

39653965
if (pp->phy_interface != state->interface) {

0 commit comments

Comments
 (0)