summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPavel Parkhomenko <Pavel.Parkhomenko@baikalelectronics.ru>2022-02-06 00:49:51 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-02-16 12:52:47 +0100
commit09295a9893198a3c3e36bf44810a078927722fd1 (patch)
treeacac148d9a5eb90c0e83c3613ca3628bfb7d342a
parentf84d17e6dd9050e1a9fb4ab570e6cde78c607df0 (diff)
downloadlinux-stable-09295a9893198a3c3e36bf44810a078927722fd1.tar.gz
linux-stable-09295a9893198a3c3e36bf44810a078927722fd1.tar.bz2
linux-stable-09295a9893198a3c3e36bf44810a078927722fd1.zip
net: phy: marvell: Fix MDI-x polarity setting in 88e1118-compatible PHYs
commit aec12836e7196e4d360b2cbf20cf7aa5139ad2ec upstream. When setting up autonegotiation for 88E1118R and compatible PHYs, a software reset of PHY is issued before setting up polarity. This is incorrect as changes of MDI Crossover Mode bits are disruptive to the normal operation and must be followed by a software reset to take effect. Let's patch m88e1118_config_aneg() to fix the issue mentioned before by invoking software reset of the PHY just after setting up MDI-x polarity. Fixes: 605f196efbf8 ("phy: Add support for Marvell 88E1118 PHY") Signed-off-by: Pavel Parkhomenko <Pavel.Parkhomenko@baikalelectronics.ru> Reviewed-by: Serge Semin <fancer.lancer@gmail.com> Suggested-by: Andrew Lunn <andrew@lunn.ch> Cc: stable@vger.kernel.org Reviewed-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/net/phy/marvell.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/net/phy/marvell.c b/drivers/net/phy/marvell.c
index 3db82162292e..53420c531266 100644
--- a/drivers/net/phy/marvell.c
+++ b/drivers/net/phy/marvell.c
@@ -888,16 +888,15 @@ static int m88e1118_config_aneg(struct phy_device *phydev)
{
int err;
- err = genphy_soft_reset(phydev);
+ err = marvell_set_polarity(phydev, phydev->mdix_ctrl);
if (err < 0)
return err;
- err = marvell_set_polarity(phydev, phydev->mdix_ctrl);
+ err = genphy_config_aneg(phydev);
if (err < 0)
return err;
- err = genphy_config_aneg(phydev);
- return 0;
+ return genphy_soft_reset(phydev);
}
static int m88e1118_config_init(struct phy_device *phydev)