Skip to contentSkip to conversation

net: phy: fix marvell phy status reading

PATCH Applied Russell King 4 participants 4 messages May 30, 2017 – May 31, 2017

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: phy: fix marvell phy status reading

The Marvell driver incorrectly provides phydev->lp_advertising as the logical and of the link partner's advert and our advert. This is incorrect - this field is supposed to store the link parter's unmodified advertisment.

This allows ethtool to report the correct link partner auto-negotiation status.

---
 drivers/net/phy/marvell.c | 2 --
 1 file changed, 2 deletions(-)
drivers/net/phy/marvell.c +0 -2
index e38f84291258..f93a7a46feb7 100644
@@ -1119,8 +1119,6 @@ static int marvell_read_status_page(struct phy_device *phydev, int page)
 		if (adv < 0)
 			return adv;
 
-		lpa &= adv;
-
 		if (status & MII_M1011_PHY_STATUS_FULLDUPLEX)
 			phydev->duplex = DUPLEX_FULL;
 		else
Signature · 1 line
2.7.4
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 18 lines · Russell King

The Marvell driver incorrectly provides phydev->lp_advertising as the logical and of the link partner's advert and our advert. This is incorrect - this field is supposed to store the link parter's unmodified advertisment.

This allows ethtool to report the correct link partner auto-negotiation status.

---
 drivers/net/phy/marvell.c | 2 --
 1 file changed, 2 deletions(-)
drivers/net/phy/marvell.c +0 -0
index e38f84291258..f93a7a46feb7 100644

drivers/net/phy/marvell.c static int marvell_read_status_page(struct phy_device *phydev, int page) · line 1124

Quoted 8 lines
drivers/net/phy/marvell.c +0 -2
@@ -1119,8 +1119,6 @@ static int marvell_read_status_page(struct phy_device *phydev, int page)
 		if (adv < 0)
 			return adv;
 
-		lpa &= adv;
-
 		if (status & MII_M1011_PHY_STATUS_FULLDUPLEX)
 			phydev->duplex = DUPLEX_FULL;
 		else

It appears that lxt.c has a similar issue. It however is not setting phydev->lp_advertising, but it is using the masked values when setting phydev->pause and phydev->asym_pause which i don't think it should do. I can create a patch for that.

Andrew

Reviewed-by on v1 1/1
#2 lore raw
In reply to Russell King
Quoted 9 lines · Russell King

The Marvell driver incorrectly provides phydev->lp_advertising as the logical and of the link partner's advert and our advert. This is incorrect - this field is supposed to store the link parter's unmodified advertisment.

This allows ethtool to report the correct link partner auto-negotiation status.

Fixes be937f1f89ca ("Marvell PHY m88e1111 driver fix")
Signature · 1 line
Florian
maintainer Applied
#3 lore raw
In reply to Russell King

From: Russell King <[email protected]>
Date: Tue, 30 May 2017 16:21:51 +0100

Quoted 9 lines

The Marvell driver incorrectly provides phydev->lp_advertising as the logical and of the link partner's advert and our advert. This is incorrect - this field is supposed to store the link parter's unmodified advertisment.

This allows ethtool to report the correct link partner auto-negotiation status.

Applied, thank you.