Commit 800dbcee authored by Jian Shen's avatar Jian Shen Committed by Greg Kroah-Hartman

net: hns3: Fix for phy link issue when using marvell phy driver

[ Upstream commit 60081dcc ]

For marvell phy m88e1510, bit SUPPORTED_FIBRE of phydev->supported
is default on. Both phy_resume() and phy_suspend() will check the
SUPPORTED_FIBRE bit and write register of fibre page.

Currently in hns3 driver, the SUPPORTED_FIBRE bit will be cleared
after phy_connect_direct() finished. Because phy_resume() is called
in phy_connect_direct(), and phy_suspend() is called when disconnect
phy device, so the operation for fibre page register is not symmetrical.
It will cause phy link issue when reload hns3 driver.

This patch fixes it by disable the SUPPORTED_FIBRE before connecting
phy.

Fixes: 256727da ("net: hns3: Add MDIO support to HNS3 Ethernet driver for hip08 SoC")
Signed-off-by: default avatarJian Shen <shenjian15@huawei.com>
Signed-off-by: default avatarPeng Li <lipeng321@huawei.com>
Signed-off-by: default avatarSalil Mehta <salil.mehta@huawei.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarSasha Levin <alexander.levin@microsoft.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent a77439e5
...@@ -187,6 +187,8 @@ int hclge_mac_start_phy(struct hclge_dev *hdev) ...@@ -187,6 +187,8 @@ int hclge_mac_start_phy(struct hclge_dev *hdev)
if (!phydev) if (!phydev)
return 0; return 0;
phydev->supported &= ~SUPPORTED_FIBRE;
ret = phy_connect_direct(netdev, phydev, ret = phy_connect_direct(netdev, phydev,
hclge_mac_adjust_link, hclge_mac_adjust_link,
PHY_INTERFACE_MODE_SGMII); PHY_INTERFACE_MODE_SGMII);
......
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