All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net] net: hns: Fix loopback test failed at copper ports
@ 2019-05-31  8:59 Yonglong Liu
  2019-06-02 20:56 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Yonglong Liu @ 2019-05-31  8:59 UTC (permalink / raw)
  To: davem
  Cc: netdev, linux-kernel, linuxarm, salil.mehta, yisen.zhuang, shiju.jose

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.

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

Signed-off-by: Yonglong Liu <liuyonglong@huawei.com>
---
 drivers/net/ethernet/hisilicon/hns/hns_ethtool.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/ethernet/hisilicon/hns/hns_ethtool.c b/drivers/net/ethernet/hisilicon/hns/hns_ethtool.c
index ce15d23..188c3f6 100644
--- a/drivers/net/ethernet/hisilicon/hns/hns_ethtool.c
+++ b/drivers/net/ethernet/hisilicon/hns/hns_ethtool.c
@@ -339,6 +339,7 @@ static int __lb_setup(struct net_device *ndev,
 static int __lb_up(struct net_device *ndev,
 		   enum hnae_loop loop_mode)
 {
+#define NIC_LB_TEST_WAIT_PHY_LINK_TIME 300
 	struct hns_nic_priv *priv = netdev_priv(ndev);
 	struct hnae_handle *h = priv->ae_handle;
 	int speed, duplex;
@@ -365,6 +366,9 @@ static int __lb_up(struct net_device *ndev,
 
 	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;
 }
 
-- 
2.8.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net] net: hns: Fix loopback test failed at copper ports
  2019-05-31  8:59 [PATCH net] net: hns: Fix loopback test failed at copper ports Yonglong Liu
@ 2019-06-02 20:56 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2019-06-02 20:56 UTC (permalink / raw)
  To: liuyonglong
  Cc: netdev, linux-kernel, linuxarm, salil.mehta, yisen.zhuang, shiju.jose

From: Yonglong Liu <liuyonglong@huawei.com>
Date: Fri, 31 May 2019 16:59:50 +0800

> 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.
> 
> Adds sleep between adjust link and test process to fix it.
> 
> Signed-off-by: Yonglong Liu <liuyonglong@huawei.com>

Applied.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-06-02 20:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-31  8:59 [PATCH net] net: hns: Fix loopback test failed at copper ports Yonglong Liu
2019-06-02 20:56 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.