History

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.

Russell King committed 6 years ago

Commit f2ca6731 parent b9fcf0a1 file · +1 −1Browse files

Unified · Split

drivers/net/ethernet/marvell/mvneta.c+1−1
@@ -3959,7 +3959,7 @@ static void mvneta_mac_config(struct phylink_config *config, unsigned int mode, · 3958 unmodified lines
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) {