Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp5122851ybf; Wed, 4 Mar 2020 17:49:06 -0800 (PST) X-Google-Smtp-Source: ADFU+vudNHyzF8Kio/WZ3urlBeJ4HX0znhIvcwmOzxA/iRZM8o7P84ACzFyYjfkZ0c9oc7F/jJmE X-Received: by 2002:a05:6808:b02:: with SMTP id s2mr3081086oij.58.1583372946191; Wed, 04 Mar 2020 17:49:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583372946; cv=none; d=google.com; s=arc-20160816; b=vVfgirYMN7lFYvIyJ7cHPenKsgolNXSh/NIj/6zUoRvKa3opttnlsEfz3dY3wX3AgK bRjABnf8j3sDQFOdzIZfmz+nVW7VjyE20qIXqIOIH+peSPErmJPB3wCKXx1BRipo1xSO AtpTRYsIQ++FZb3R/yVw+I7yK80pld4+sZ4acBFALvwCltbDML4j2uv+XUzSBPr79rJx KobJHhnUQNuTIOrt09toqt35jk+keJX4v+V+aJj/3F5BNz7gVA4BRGHulEZvqJzub41R aXj+rnfiuNRdfZndrpiN0M0zADvzCC5CAU81GePbaYCoMycZvKYebFV9/fwNxHv6sZqI mOow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=RSWxHeWD1laevHH8eVwhoqPE9Dx749J3xoSBBdh1haA=; b=ATbDrgt+SRYAUO+2xURUl0MtnTzuLkReMZ9Kfzabvvn2vr34uRuEW3iVQlAvxDlgJC FbvclX33fstXnAhfBa6j5DeW56Bp+cadIbn1V/tP8e4V6KJYd1yrIELApUrSifVEzdGZ xynGt6SMoBrx/upng/6Mc9ChxU4o/mAY/rduYBJQxUxr6lV3u1OO19GXL8lk0wDxL+W6 2zAa536lAaQXfki/MZOO3nr7FbOeWsl2bR3EUHStMZj/gRFxVOuDBbt7a4KzH6AC3Jhw wnUPJdHMPgKKI9NlontmGsGnIZSWnLMtZv5J/ABri6dzn7pB8qz2I7hdRIFNuAWRwoQ/ jshg== ARC-Authentication-Results: i=1; mx.google.com; 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 t28si1290194ott.83.2020.03.04.17.48.53; Wed, 04 Mar 2020 17:49:06 -0800 (PST) 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; 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 S1725912AbgCEBsh (ORCPT + 99 others); Wed, 4 Mar 2020 20:48:37 -0500 Received: from szxga06-in.huawei.com ([45.249.212.32]:50176 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725838AbgCEBsh (ORCPT ); Wed, 4 Mar 2020 20:48:37 -0500 Received: from DGGEMS413-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 44727AE23C716FD804E0; Thu, 5 Mar 2020 09:48:35 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by DGGEMS413-HUB.china.huawei.com (10.3.19.213) with Microsoft SMTP Server id 14.3.439.0; Thu, 5 Mar 2020 09:48:27 +0800 From: Huazhong Tan To: CC: , , , , , , Jian Shen , Huazhong Tan Subject: [PATCH net] net: hns3: fix a not link up issue when fibre port supports autoneg Date: Thu, 5 Mar 2020 09:47:53 +0800 Message-ID: <1583372873-26924-1-git-send-email-tanhuazhong@huawei.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.69.192.56] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jian Shen When fibre port supports auto-negotiation, the IMP(Intelligent Management Process) processes the speed of auto-negotiation and the user's speed separately. For below case, the port will get a not link up problem. step 1: disables auto-negotiation and sets speed to A, then the driver's MAC speed will be updated to A. step 2: enables auto-negotiation and MAC gets negotiated speed B, then the driver's MAC speed will be updated to B through querying in periodical task. step 3: MAC gets new negotiated speed A. step 4: disables auto-negotiation and sets speed to B before periodical task query new MAC speed A, the driver will ignore the speed configuration. This patch fixes it by skipping speed and duplex checking when fibre port supports auto-negotiation. Fixes: 22f48e24a23d ("net: hns3: add autoneg and change speed support for fibre port") Signed-off-by: Jian Shen Signed-off-by: Huazhong Tan --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c index 492bc94..acf0c29f 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c @@ -2446,10 +2446,12 @@ static int hclge_cfg_mac_speed_dup_hw(struct hclge_dev *hdev, int speed, int hclge_cfg_mac_speed_dup(struct hclge_dev *hdev, int speed, u8 duplex) { + struct hclge_mac *mac = &hdev->hw.mac; int ret; duplex = hclge_check_speed_dup(duplex, speed); - if (hdev->hw.mac.speed == speed && hdev->hw.mac.duplex == duplex) + if (!mac->support_autoneg && mac->speed == speed && + mac->duplex == duplex) return 0; ret = hclge_cfg_mac_speed_dup_hw(hdev, speed, duplex); -- 2.7.4