Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp2234119ybd; Mon, 24 Jun 2019 03:02:43 -0700 (PDT) X-Google-Smtp-Source: APXvYqyVYzFQOgIHfcFsiI/Pwi7/+/y5w0DWoV328lhydEoHdo6bjtIG4cjbInry/SNUL9j3nZxA X-Received: by 2002:a17:902:9a84:: with SMTP id w4mr44411996plp.160.1561370563361; Mon, 24 Jun 2019 03:02:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561370563; cv=none; d=google.com; s=arc-20160816; b=AM5dY+zzFNNnPv49ZTXvD5/HRWXby7VHW/oj9ClENbu5NdPox1WEZSSZdjOee2bjcV K/sZlhMNVxHLMErYczG7pYe3LSFYkVpFD/lHy0pMj3L93R3EhCxYBogOGIYa2HDe3Rtg Z18n9rDA6RdU00PWEyQW8WJFlnVt1P/QCbb4eMPck4QN4Rk0LXWKYSsgg1QH+sPYZRul 6t+EqZ6nulNgjbCvfxAZV7CJ+gxhCYA0rcRkWWK/vFRUf+RqFYtifwxrFHi702XAvCEU ZNVrAyd5QZVnn8xEsiXI4ituMWAH41BT7kwYLWNV5OofSF2YvNMP7t53sfMuAf99VWe7 Z6ZA== 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=07KXUL6g5qCAku5C8ZA5qWUWEt0Lo715NUQK0FlFTAk=; b=I2CSH4bIdOSXjEiHFmpHFEEPO1ZvyVOzMWFZhFLtyJwJpaSwli9h9pyL48L+h1bASW j/u64LiPA5ESzMVpUDZsXiqSZY4EOAEqAPHxeMnW60iG9LhQ5Hm652oZX6oZCJNdnFoT utSQbwuzicUPb46KiuXAvZ7MSQsnxYMxZg1Xrld0WRZaAkwLV9VKHTk/J/lgCUrpIigo 0sfUKgD6qdNnY4fFQpLjoCIYm07yThXZOHSJDSbNV80WHY30O2Q1jhMIWH26tIjHXrs2 XFkDTb0CY5PPK+KiPZLC3WvwQtoC773a74E6J+KKVqcJrlEzTdT3dHSv2wlr9UKpl32q jy1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ba02AmYm; 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 m39si9728459plg.155.2019.06.24.03.02.16; Mon, 24 Jun 2019 03:02:43 -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=ba02AmYm; 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 S1728999AbfFXJ63 (ORCPT + 99 others); Mon, 24 Jun 2019 05:58:29 -0400 Received: from mail.kernel.org ([198.145.29.99]:57030 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728988AbfFXJ61 (ORCPT ); Mon, 24 Jun 2019 05:58:27 -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 7E12F2133F; Mon, 24 Jun 2019 09:58:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1561370307; bh=nE/1FQTySd98J+zFhzWiW+xhzSYcp2gbPb9bmQWUo2o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ba02AmYmCY6OQOrYFkomkecXNIK3EOqh7rRO6D0U1NAu5Kfw+bP9rZe1GCpwFmpgy MVzwS32QjtJ0nqbuCCEpUCM/4+xrwwbT0oHDQLJR7zMv8Sg4UamcVPpg98TTtpZ+YY fiedLsZsF+uosA6N09VI66/e3y46ZBytXtBT2M88= 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 4.14 24/51] net: hns: Fix loopback test failed at copper ports Date: Mon, 24 Jun 2019 17:56:42 +0800 Message-Id: <20190624092309.199330544@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190624092305.919204959@linuxfoundation.org> References: <20190624092305.919204959@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 14df03f60e05..523d52fbaafe 100644 --- a/drivers/net/ethernet/hisilicon/hns/hns_ethtool.c +++ b/drivers/net/ethernet/hisilicon/hns/hns_ethtool.c @@ -338,6 +338,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; @@ -364,6 +365,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