Commit 881cc731 authored by Jonathan McDowell's avatar Jonathan McDowell Committed by David S. Miller
Browse files

net: phy: Fix qca8081 with speeds lower than 2.5Gb/s



A typo in qca808x_read_status means we try to set SMII mode on the port
rather than SGMII when the link speed is not 2.5Gb/s. This results in no
traffic due to the mismatch in configuration between the phy and the
mac.

v2:
 Only change interface mode when the link is up

Fixes: 79c7bc05 ("net: phy: add qca8081 read_status")
Cc: stable@vger.kernel.org
Signed-off-by: default avatarJonathan McDowell <noodles@earth.li>
Reviewed-by: default avatarRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 9cef24c8
Loading
Loading
Loading
Loading
+13 −13
Original line number Diff line number Diff line
@@ -1688,11 +1688,12 @@ static int qca808x_read_status(struct phy_device *phydev)
	if (ret < 0)
		return ret;

	if (phydev->link && phydev->speed == SPEED_2500)
	if (phydev->link) {
		if (phydev->speed == SPEED_2500)
			phydev->interface = PHY_INTERFACE_MODE_2500BASEX;
		else
		phydev->interface = PHY_INTERFACE_MODE_SMII;

			phydev->interface = PHY_INTERFACE_MODE_SGMII;
	} else {
		/* generate seed as a lower random value to make PHY linked as SLAVE easily,
		 * except for master/slave configuration fault detected.
		 * the reason for not putting this code into the function link_change_notify is
@@ -1700,7 +1701,6 @@ static int qca808x_read_status(struct phy_device *phydev)
		 * value is configured as the same value, the link can't be up and no link change
		 * occurs.
		 */
	if (!phydev->link) {
		if (phydev->master_slave_state == MASTER_SLAVE_STATE_ERR) {
			qca808x_phy_ms_seed_enable(phydev, false);
		} else {