Skip to content

Commit 881cc73

Browse files
u1f35cdavem330
authored andcommitted
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: 79c7bc0 ("net: phy: add qca8081 read_status") Cc: [email protected] Signed-off-by: Jonathan McDowell <[email protected]> Reviewed-by: Russell King (Oracle) <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 9cef24c commit 881cc73

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

drivers/net/phy/at803x.c

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1688,19 +1688,19 @@ static int qca808x_read_status(struct phy_device *phydev)
16881688
if (ret < 0)
16891689
return ret;
16901690

1691-
if (phydev->link && phydev->speed == SPEED_2500)
1692-
phydev->interface = PHY_INTERFACE_MODE_2500BASEX;
1693-
else
1694-
phydev->interface = PHY_INTERFACE_MODE_SMII;
1695-
1696-
/* generate seed as a lower random value to make PHY linked as SLAVE easily,
1697-
* except for master/slave configuration fault detected.
1698-
* the reason for not putting this code into the function link_change_notify is
1699-
* the corner case where the link partner is also the qca8081 PHY and the seed
1700-
* value is configured as the same value, the link can't be up and no link change
1701-
* occurs.
1702-
*/
1703-
if (!phydev->link) {
1691+
if (phydev->link) {
1692+
if (phydev->speed == SPEED_2500)
1693+
phydev->interface = PHY_INTERFACE_MODE_2500BASEX;
1694+
else
1695+
phydev->interface = PHY_INTERFACE_MODE_SGMII;
1696+
} else {
1697+
/* generate seed as a lower random value to make PHY linked as SLAVE easily,
1698+
* except for master/slave configuration fault detected.
1699+
* the reason for not putting this code into the function link_change_notify is
1700+
* the corner case where the link partner is also the qca8081 PHY and the seed
1701+
* value is configured as the same value, the link can't be up and no link change
1702+
* occurs.
1703+
*/
17041704
if (phydev->master_slave_state == MASTER_SLAVE_STATE_ERR) {
17051705
qca808x_phy_ms_seed_enable(phydev, false);
17061706
} else {

0 commit comments

Comments
 (0)