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

net: phy: marvell: Fix RGMII Tx/Rx delays setting in 88e1121-compatible PHYs

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

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

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

commit fe4f57bf upstream.

It is mandatory for a software to issue a reset upon modifying RGMII
Receive Timing Control and RGMII Transmit Timing Control bit fields of MAC
Specific Control register 2 (page 2, register 21) otherwise the changes
won't be perceived by the PHY (the same is applicable for a lot of other
registers). Not setting the RGMII delays on the platforms that imply it'
being done on the PHY side will consequently cause the traffic loss. We
discovered that the denoted soft-reset is missing in the
m88e1121_config_aneg() method for the case if the RGMII delays are
modified but the MDIx polarity isn't changed or the auto-negotiation is
left enabled, thus causing the traffic loss on our platform with Marvell
Alaska 88E1510 installed. Let's fix that by issuing the soft-reset if the
delays have been actually set in the m88e1121_config_aneg_rgmii_delays()
method.

Cc: stable@vger.kernel.org
Fixes: d6ab9336 ("net: phy: marvell: Avoid unnecessary soft reset")
Signed-off-by: NPavel Parkhomenko <Pavel.Parkhomenko@baikalelectronics.ru>
Reviewed-by: NRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Reviewed-by: NSerge Semin <fancer.lancer@gmail.com>
Link: https://lore.kernel.org/r/20220205203932.26899-1-Pavel.Parkhomenko@baikalelectronics.ruSigned-off-by: NJakub Kicinski <kuba@kernel.org>
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>
上级 67e25248
...@@ -515,7 +515,7 @@ static int m88e1121_config_aneg_rgmii_delays(struct phy_device *phydev) ...@@ -515,7 +515,7 @@ static int m88e1121_config_aneg_rgmii_delays(struct phy_device *phydev)
else else
mscr = 0; mscr = 0;
return phy_modify_paged(phydev, MII_MARVELL_MSCR_PAGE, return phy_modify_paged_changed(phydev, MII_MARVELL_MSCR_PAGE,
MII_88E1121_PHY_MSCR_REG, MII_88E1121_PHY_MSCR_REG,
MII_88E1121_PHY_MSCR_DELAY_MASK, mscr); MII_88E1121_PHY_MSCR_DELAY_MASK, mscr);
} }
...@@ -531,11 +531,13 @@ static int m88e1121_config_aneg(struct phy_device *phydev) ...@@ -531,11 +531,13 @@ static int m88e1121_config_aneg(struct phy_device *phydev)
return err; return err;
} }
changed = err;
err = marvell_set_polarity(phydev, phydev->mdix_ctrl); err = marvell_set_polarity(phydev, phydev->mdix_ctrl);
if (err < 0) if (err < 0)
return err; return err;
changed = err; changed |= err;
err = genphy_config_aneg(phydev); err = genphy_config_aneg(phydev);
if (err < 0) if (err < 0)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册