Commit 5aeaa36b authored by Heiner Kallweit's avatar Heiner Kallweit Committed by Greg Kroah-Hartman

net: phy: don't clear BMCR in genphy_soft_reset

[ Upstream commit d29f5aa0 ]

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

Fixes: 6e2d85ec ("net: phy: Stop with excessive soft reset")
Tested-by: default avatarPhil Reid <preid@electromag.com.au>
Tested-by: default avatarliweihang <liweihang@hisilicon.com>
Signed-off-by: default avatarHeiner Kallweit <hkallweit1@gmail.com>
Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 0e20c6ed
...@@ -1657,7 +1657,7 @@ int genphy_soft_reset(struct phy_device *phydev) ...@@ -1657,7 +1657,7 @@ int genphy_soft_reset(struct phy_device *phydev)
{ {
int ret; int ret;
ret = phy_write(phydev, MII_BMCR, BMCR_RESET); ret = phy_set_bits(phydev, MII_BMCR, BMCR_RESET);
if (ret < 0) if (ret < 0)
return ret; return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment