Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp942777imm; Tue, 15 May 2018 11:24:30 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoWpVha8Zscoc3VnlqBMK65pF2T9NlLndmHaKBTVLAChhsdAz6PWW1bjj3HtSLLxGl9m0Va X-Received: by 2002:a62:cc08:: with SMTP id a8-v6mr16091295pfg.219.1526408670842; Tue, 15 May 2018 11:24:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526408670; cv=none; d=google.com; s=arc-20160816; b=0u1FPlkZ89sYpxtT5GKxUoOQbSTClEUuKHNyAuk1jErQQiFmeRF+n2fLDdL9Qjzeyh tElGyoaxEkoPtKJlgbRoaJh0hvpCXZeBoBIh3w2TYE5BICeCbg29E3ecMBhLMR4VrMIY Lvplc7K8BB3gtGVKrnA2b8O4GFFSMxRgwZhzdOOOMjM0IMu7OFwTPagJp5eXHFHr6cMJ jj3P+3Ins5ar9tc/iB/MhKLMPDNYBY/RwmH8sgAqaE77BLs1OgEdpSso1QPZA9qKEdYo X92HFrpnyYqOPihmyHeUM2mVV8Y84cqZ1CfABYbx1xb8DN5TaNgl594rT9RxiEstGNlu Onhg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:arc-authentication-results; bh=vYxp/2MJWYKRZhjs6uMi7MhS3IKyKznaDGakv4I0b7M=; b=qJlNe4PJhh6Xch8Nzv5xmc1RHUI5bqBYVswQ/tnUZm5FbAV4acyM4OgqxHqNeYT+MC NDJFNEQvaUnxuMIZt/sReiTbkd+eetDjGFoQjMBRFJgGt/EM00LjssGnuqy0dFG7xuqX 92f015b9NHFKV3JZE3Fqs4Paarzkr0xzdA4mtA/9qgGTIdKeyUT/FKFvEcR2g7GzEXmP ulDtckPm7ynWTsVqYDj4SPicWgY0Kik2Zw2qrbX7nSVkB1WIRzHv/wejJnoS8ct04e8q Hfs5OLkhOM2w6ROYAzBTsOm1sZCtuAwgngD5/WTBuSti5APIYU7dBxcjpMz7wK1DBLZ9 Twmw== 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 i16-v6si439426pgn.682.2018.05.15.11.24.16; Tue, 15 May 2018 11:24:30 -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; 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 S1753562AbeEOSVd (ORCPT + 99 others); Tue, 15 May 2018 14:21:33 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:59571 "EHLO huawei.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1752861AbeEOSVb (ORCPT ); Tue, 15 May 2018 14:21:31 -0400 Received: from DGGEMS403-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id D7546C55B3F7C; Wed, 16 May 2018 02:21:26 +0800 (CST) Received: from S00293818-DELL1.china.huawei.com (10.202.227.234) by DGGEMS403-HUB.china.huawei.com (10.3.19.203) with Microsoft SMTP Server id 14.3.382.0; Wed, 16 May 2018 02:21:18 +0800 From: Salil Mehta To: CC: , , , , , , , Yunsheng Lin Subject: [PATCH net-next 08/10] net: hns3: Fix for fiber link up problem Date: Tue, 15 May 2018 19:20:12 +0100 Message-ID: <20180515182014.42196-9-salil.mehta@huawei.com> X-Mailer: git-send-email 2.8.3 In-Reply-To: <20180515182014.42196-1-salil.mehta@huawei.com> References: <20180515182014.42196-1-salil.mehta@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.202.227.234] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Yunsheng Lin When hclge_ae_start is called, hdev->hw.mac.link may be set to one after up/down multi-times, which does not correspond to the link state of netdev when the netdev is up. This fixes it by setting hdev->hw.mac.link to zero when hclge_ae_start is called. Fixes: 46a3df9f9718 ("net: hns3: Add HNS3 Acceleration Engine & Compatibility Layer Support") Signed-off-by: Yunsheng Lin Signed-off-by: Peng Li Signed-off-by: Salil Mehta --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 2 +- 1 file changed, 1 insertion(+), 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 d060903..75d9b8c 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c @@ -3756,6 +3756,7 @@ static int hclge_ae_start(struct hnae3_handle *handle) hclge_cfg_mac_mode(hdev, true); clear_bit(HCLGE_STATE_DOWN, &hdev->state); mod_timer(&hdev->service_timer, jiffies + HZ); + hdev->hw.mac.link = 0; /* reset tqp stats */ hclge_reset_tqp_stats(handle); @@ -3792,7 +3793,6 @@ static void hclge_ae_stop(struct hnae3_handle *handle) /* reset tqp stats */ hclge_reset_tqp_stats(handle); - hclge_update_link_status(hdev); } static int hclge_get_mac_vlan_cmd_status(struct hclge_vport *vport, -- 2.7.4