[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <lsq.1565469607.97542613@decadent.org.uk>
Date: Sat, 10 Aug 2019 21:40:07 +0100
From: Ben Hutchings <ben@...adent.org.uk>
To: linux-kernel@...r.kernel.org, stable@...r.kernel.org
CC: akpm@...ux-foundation.org, Denis Kirjanov <kda@...ux-powerpc.org>,
"Heiner Kallweit" <hkallweit1@...il.com>,
"Phil Reid" <preid@...ctromag.com.au>,
"David S. Miller" <davem@...emloft.net>,
"liweihang" <liweihang@...ilicon.com>,
"Florian Fainelli" <f.fainelli@...il.com>
Subject: [PATCH 3.16 049/157] net: phy: don't clear BMCR in genphy_soft_reset
3.16.72-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Heiner Kallweit <hkallweit1@...il.com>
commit d29f5aa0bc0c321e1b9e4658a2a7e08e885da52a upstream.
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: 6e2d85ec0559 ("net: phy: Stop with excessive soft reset")
Tested-by: Phil Reid <preid@...ctromag.com.au>
Tested-by: liweihang <liweihang@...ilicon.com>
Signed-off-by: Heiner Kallweit <hkallweit1@...il.com>
Reviewed-by: Florian Fainelli <f.fainelli@...il.com>
Signed-off-by: David S. Miller <davem@...emloft.net>
[bwh: Backported to 3.16: open-code phy_set_bits()]
Signed-off-by: Ben Hutchings <ben@...adent.org.uk>
---
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
@@ -1072,7 +1072,10 @@ int genphy_soft_reset(struct phy_device
{
int ret;
- ret = phy_write(phydev, MII_BMCR, BMCR_RESET);
+ ret = phy_read(phydev, MII_BMCR);
+ if (ret < 0)
+ return ret;
+ ret = phy_write(phydev, MII_BMCR, ret | BMCR_RESET);
if (ret < 0)
return ret;
Powered by blists - more mailing lists