Revert "net: phy: phy_device: repeat reading of the phy-state when state is down"

Repeated reading of the phy-state does not help in preventing spurious
link down.

This reverts commit 621a26e5dd.

Signed-off-by: Jan Sondhauss <jan.sondhauss@wago.com>
This commit is contained in:
Jan Sondhauss
2025-11-18 10:24:52 +01:00
committed by Jan SONDHAUSS
parent 5c511313fa
commit e2ee500d29
+4 -15
View File
@@ -2343,13 +2343,12 @@ EXPORT_SYMBOL(genphy_aneg_done);
*/
int genphy_update_link(struct phy_device *phydev)
{
int status = 0, bmcr, i;
int status = 0, bmcr;
bmcr = phy_read(phydev, MII_BMCR);
if (bmcr < 0)
return bmcr;
/* Autoneg is being started, therefore disregard BMSR value and
* report link as down.
*/
@@ -2370,19 +2369,9 @@ int genphy_update_link(struct phy_device *phydev)
}
/* Read link and autonegotiation status */
for (i = 0; i < 20; i++) {
status = phy_read(phydev, MII_BMSR);
if (status < 0)
return status;
if (status & BMSR_LSTATUS)
break;
cpu_relax();
}
if (status & BMSR_LSTATUS)
if (i >= 1)
phydev_info(phydev, "link up after multiple reads: %di\n", i);
status = phy_read(phydev, MII_BMSR);
if (status < 0)
return status;
done:
phydev->link = status & BMSR_LSTATUS ? 1 : 0;
phydev->autoneg_complete = status & BMSR_ANEGCOMPLETE ? 1 : 0;