]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
net: hns3: disable phy loopback setting in hclge_mac_start_phy
authorYufeng Mo <moyufeng@huawei.com>
Fri, 30 Apr 2021 09:06:22 +0000 (17:06 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 19 May 2021 08:29:44 +0000 (10:29 +0200)
[ Upstream commit 472497d0bdae890a896013332a0b673f9acdf2bf ]

If selftest and reset are performed at the same time, the phy
loopback setting may be still in enable state after the reset,
and device cannot link up. So fix this issue by disabling phy
loopback before phy_start().

Fixes: 256727da7395 ("net: hns3: Add MDIO support to HNS3 Ethernet driver for hip08 SoC")
Signed-off-by: Yufeng Mo <moyufeng@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c

index e898207025406099b206b3a8e9cceac14dce2421..c194bba187d6c72943b42f764f37d1d2fa64e973 100644 (file)
@@ -255,6 +255,8 @@ void hclge_mac_start_phy(struct hclge_dev *hdev)
        if (!phydev)
                return;
 
+       phy_loopback(phydev, false);
+
        phy_start(phydev);
 }