Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp2248017ybd; Mon, 24 Jun 2019 03:15:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqzlMP9yvFmF6UOCPDz0SMWS7UCZxBlg8BWJGFfBp57YYfT/PIxxr7UysvrQGzIoBUB/NKaK X-Received: by 2002:a17:902:7603:: with SMTP id k3mr40287905pll.245.1561371354806; Mon, 24 Jun 2019 03:15:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561371354; cv=none; d=google.com; s=arc-20160816; b=TQ4FVuDycmKhqjqZZpG5G+kkG1EfqwhCZwppvCVni+7969jD1umGrlL4TI9xb7Fq1e mw1qcb4A4nQH4cq6wEhZ37QRlphNgq6dLW7VEje9gonsHJbm9ayReAMTPtPOL12uZgXS Ag2oN7wzeesI0y80n7FOyGKyab1uEE6v7k4c2drQBugK5/v61HnCxDx6sWSWpMuyhqS7 TdLkTzudzjzcaV4gyuVceFP29jKij4ZeZ3bCCnFdBSiGvvrCozOSboON3IyoVSfQyHhW apluEQMnR0bFJPPwaKFqZj5qsv1tk891nx+RcHG0FOI0ILFMx/b3PhkcdIt/1Mg8PNDi reFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=LeXBXq4vKwCd/MK3YDwM2XZYZ+8xGYyJrzUjLz71f6g=; b=S8qNWIQRQhTR80utgjPI0BPCEtqw8A1BvkSNudMUK0Fn469m41dQrt/k2kDmDcBnB3 Rv9jyCWghlIDwkVoShf3rjYB9GDNpdwEppQ/k3PyvvC3zPDmTlnxdAHTbf9Sx9SyKq3x yCsjEZ9MmjB0RhY6Zr6XKgQZkzAWf+E73kdNBP95IpMIpWoWsw8WJjkyGoM5ee1hQFyR BgqlPgFzRY0gjNofVWm+TgJv4QOcBy6JTPsfOexa1yf1VhgR5FEnob9ZFxSgYYkVBvWg u09ULVFMKrQKYsTqF9/7B5TrcMwnGF8pGdxtYqR2ao6vh0s6W8Q1eQPcwcxvOUTGZltZ p8NQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=k2onZulR; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c1si7917038pgp.45.2019.06.24.03.15.38; Mon, 24 Jun 2019 03:15:54 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=k2onZulR; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730489AbfFXKNj (ORCPT + 99 others); Mon, 24 Jun 2019 06:13:39 -0400 Received: from mail.kernel.org ([198.145.29.99]:50500 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729927AbfFXKNg (ORCPT ); Mon, 24 Jun 2019 06:13:36 -0400 Received: from localhost (f4.8f.5177.ip4.static.sl-reverse.com [119.81.143.244]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 94B922146F; Mon, 24 Jun 2019 10:13:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1561371216; bh=NGFx8s4u0BBPyadAYUvyyhEZ5g7UlcVWPOOwe7iXMXI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=k2onZulR11hYQ4NsttqoM296DlIR+SLf7gQEGiriHXiUrs2KXRgRVYf6sRW9on/8L KAuVGu0hVGyyyDSM0R7a+ahBbDaSGo1oepuT7erA+zsqcY4gKVtL/zBCTotMclMBGV ofvQUaGeaPJyRwNirzd9bqSv4J1iT2K00tqIiy4Q= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Yonglong Liu , "David S. Miller" , Sasha Levin Subject: [PATCH 5.1 064/121] net: hns: Fix loopback test failed at copper ports Date: Mon, 24 Jun 2019 17:56:36 +0800 Message-Id: <20190624092324.063486207@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190624092320.652599624@linuxfoundation.org> References: <20190624092320.652599624@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit 2e1f164861e500f4e068a9d909bbd3fcc7841483 ] 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 Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- 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 ce15d2350db9..188c3f6791b5 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.20.1