提交 858f38ef 编写于 作者: Y Yonglong Liu 提交者: Xie XiuQi

net: hns: Fix loopback test failed at copper ports

driver inclusion
category: bugfix
bugzilla: NA
CVE: NA

When doing a loopback test at copper ports, the serdes loopback
and the phy loopback will fail, because of the adjust link had
not finished, and phy not ready.

Add sleep between adjust link and test process to fix it.

Feature or Bugfix:Bugfix
Signed-off-by: NYonglong Liu <liuyonglong@huawei.com>
Reviewed-by: Nlipeng <lipeng321@huawei.com>
Reviewed-by: NYang Yingliang <yangyingliang@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 34ca9b6e
...@@ -339,6 +339,7 @@ static int __lb_setup(struct net_device *ndev, ...@@ -339,6 +339,7 @@ static int __lb_setup(struct net_device *ndev,
static int __lb_up(struct net_device *ndev, static int __lb_up(struct net_device *ndev,
enum hnae_loop loop_mode) enum hnae_loop loop_mode)
{ {
#define NIC_LB_TEST_WAIT_PHY_LINK_TIME (300)
struct hns_nic_priv *priv = netdev_priv(ndev); struct hns_nic_priv *priv = netdev_priv(ndev);
struct hnae_handle *h = priv->ae_handle; struct hnae_handle *h = priv->ae_handle;
int speed, duplex; int speed, duplex;
...@@ -365,6 +366,9 @@ static int __lb_up(struct net_device *ndev, ...@@ -365,6 +366,9 @@ static int __lb_up(struct net_device *ndev,
h->dev->ops->adjust_link(h, speed, duplex); h->dev->ops->adjust_link(h, speed, duplex);
/* wait adjust link done and phy ready */
msleep(NIC_LB_TEST_WAIT_PHY_LINK_TIME);
return 0; return 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册