diff mbox series

[net-next,4/4] net: hns3: disable phy loopback setting in hclge_mac_start_phy

Message ID 1619773582-17828-5-git-send-email-tanhuazhong@huawei.com (mailing list archive)
State Accepted
Commit 472497d0bdae890a896013332a0b673f9acdf2bf
Delegated to: Netdev Maintainers
Headers show
Series net: hns3: fixes for -net | expand

Checks

Context Check Description
netdev/cover_letter success Link
netdev/fixes_present success Link
netdev/patch_count success Link
netdev/tree_selection success Clearly marked for net-next
netdev/subject_prefix success Link
netdev/cc_maintainers fail 2 blamed authors not CCed: lipeng321@huawei.com huangdaode@hisilicon.com; 3 maintainers not CCed: lipeng321@huawei.com huangdaode@hisilicon.com huangguangbin2@huawei.com
netdev/source_inline success Was 0 now: 0
netdev/verify_signedoff success Link
netdev/module_param success Was 0 now: 0
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/verify_fixes success Link
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 8 lines checked
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/header_inline success Link

Commit Message

Huazhong Tan April 30, 2021, 9:06 a.m. UTC
From: Yufeng Mo <moyufeng@huawei.com>

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>
---
 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Andrew Lunn April 30, 2021, 12:52 p.m. UTC | #1
On Fri, Apr 30, 2021 at 05:06:22PM +0800, Huazhong Tan wrote:
> From: Yufeng Mo <moyufeng@huawei.com>
> 
> 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().

This sounds like a generic problem, not specific to your
driver. Please look at solving this within phy_start().

	Andrew
Huazhong Tan May 4, 2021, 7:38 a.m. UTC | #2
On 2021/4/30 20:52, Andrew Lunn wrote:
> On Fri, Apr 30, 2021 at 05:06:22PM +0800, Huazhong Tan wrote:
>> From: Yufeng Mo <moyufeng@huawei.com>
>>
>> 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().
> This sounds like a generic problem, not specific to your
> driver. Please look at solving this within phy_start().
>
> 	Andrew


I will try to send another patch to do that.

thanks.


> .
diff mbox series

Patch

diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c
index 08e88d9..1231c34 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c
@@ -255,6 +255,8 @@  void hclge_mac_start_phy(struct hclge_dev *hdev)
 	if (!phydev)
 		return;
 
+	phy_loopback(phydev, false);
+
 	phy_start(phydev);
 }