net: phy: don't clear BMCR in genphy_soft_reset
Subsystems (3)
Heiner Kallweit
maintainerPATCH 1/1 net: phy: don't clear BMCR in genphy_soft_reset
So far we effectively clear the BMCR register. Some PHY's can deal with this (e.g. because they reset BMCR to a default as part of a soft-reset) whilst on others this causes issues because e.g. the autoneg bit is cleared. Marvell is an example, see also thread [0]. So let's be a little bit more gentle and leave all bits we're not interested in as-is. This change is needed for PHY drivers to properly deal with the original patch.
[0] https://marc.info/?t=155264050700001&r=1&w=2
--- drivers/net/phy/phy_device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/phy/phy_device.c +1 -1
@@ -1831,7 +1831,7 @@ int genphy_soft_reset(struct phy_device *phydev) {int ret; - ret =phy_write (phydev,MII_BMCR ,BMCR_RESET ); + ret =phy_set_bits (phydev,MII_BMCR ,BMCR_RESET );if (ret <0 )return ret;
Signature · 1 line
2.21.0
Quoted 8 lines · Heiner Kallweit
So far we effectively clear the BMCR register. Some PHY's can deal with this (e.g. because they reset BMCR to a default as part of a soft-reset) whilst on others this causes issues because e.g. the autoneg bit is cleared. Marvell is an example, see also thread [0]. So let's be a little bit more gentle and leave all bits we're not interested in as-is. This change is needed for PHY drivers to properly deal with the original patch.
Quoted 6 lines
[0] https://marc.info/?t=155264050700001&r=1&w=2
Fixes 6e2d85ec0559 ("net: phy: Stop with excessive soft reset")Tested-by Phil Reid <[email protected]>Tested-by liweihang <[email protected]>Signed-off-by Heiner Kallweit <[email protected]>
Thanks for investigating and coming up with a fix for this!
Quoted 18 lines
--- drivers/net/phy/phy_device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/net/phy/phy_device.c +1
-1@@ -1831,7 +1831,7 @@ int genphy_soft_reset(struct phy_device *phydev) {int ret; - ret =phy_write (phydev,MII_BMCR ,BMCR_RESET ); + ret =phy_set_bits (phydev,MII_BMCR ,BMCR_RESET );if (ret <0 )return ret;
Signature · 1 line
Florian
David Miller
maintainerFrom: Heiner Kallweit <[email protected]>
Date: Fri, 22 Mar 2019 20:00:20 +0100
Quoted 8 lines
So far we effectively clear the BMCR register. Some PHY's can deal with this (e.g. because they reset BMCR to a default as part of a soft-reset) whilst on others this causes issues because e.g. the autoneg bit is cleared. Marvell is an example, see also thread [0]. So let's be a little bit more gentle and leave all bits we're not interested in as-is. This change is needed for PHY drivers to properly deal with the original patch.
Quoted 6 lines
[0] https://marc.info/?t=155264050700001&r=1&w=2
Fixes 6e2d85ec0559 ("net: phy: Stop with excessive soft reset")Tested-by Phil Reid <[email protected]>Tested-by liweihang <[email protected]>Signed-off-by Heiner Kallweit <[email protected]>
Applied and queued up for -stable, thanks.