提交 47182432 编写于 作者: P Pavel Parkhomenko 提交者: Zheng Zengkai

net: phy: marvell: Fix MDI-x polarity setting in 88e1118-compatible PHYs

stable inclusion
from stable-v5.10.101
commit f47ee3a35ffb5a8534959ec82c7a0dda3f0d3249
bugzilla: https://gitee.com/openeuler/kernel/issues/I5669Z

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=f47ee3a35ffb5a8534959ec82c7a0dda3f0d3249

--------------------------------

commit aec12836 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: 605f196e ("phy: Add support for Marvell 88E1118 PHY")
Signed-off-by: NPavel Parkhomenko <Pavel.Parkhomenko@baikalelectronics.ru>
Reviewed-by: NSerge Semin <fancer.lancer@gmail.com>
Suggested-by: NAndrew Lunn <andrew@lunn.ch>
Cc: stable@vger.kernel.org
Reviewed-by: NAndrew Lunn <andrew@lunn.ch>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NYu Liao <liaoyu15@huawei.com>
Reviewed-by: NWei Li <liwei391@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 fd1da5e1
......@@ -1061,16 +1061,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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册