Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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")
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Russell King and committed by
David S. Miller
f2ca673d b9fcf0a0

+1 -1
+1 -1
drivers/net/ethernet/marvell/mvneta.c
··· 3959 3959 /* When at 2.5G, the link partner can send frames with shortened 3960 3960 * preambles. 3961 3961 */ 3962 - if (state->speed == SPEED_2500) 3962 + if (state->interface == PHY_INTERFACE_MODE_2500BASEX) 3963 3963 new_ctrl4 |= MVNETA_GMAC4_SHORT_PREAMBLE_ENABLE; 3964 3964 3965 3965 if (pp->phy_interface != state->interface) {