From patchwork Tue May 15 18:20:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Salil Mehta X-Patchwork-Id: 135921 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp1373228lji; Tue, 15 May 2018 11:22:58 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqbj/v+PT31aWsQpb1E1zsHwRToU3Dn5IsRNGxU++E0MArghKXsC4WD7ZmfUcMBsHQx2oT2 X-Received: by 2002:a62:8605:: with SMTP id x5-v6mr16244399pfd.103.1526408578245; Tue, 15 May 2018 11:22:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526408578; cv=none; d=google.com; s=arc-20160816; b=F+K6kVrHuz/nEywk7re38m7KsIbs9FZoCvB9lDqZcCGvEKo2gnXuQ1XrhAH9Txrxv8 Hebc62G+aBrI0/uo8pa1TeMkEdyY6FZnqF7QKJaLXpTMQjJHlAHdZt6p9srjE8e9P2+2 seaDHbW5NK5c8/7WQUoAdCUbdSYcPHU7Szh/vm2uNziTu/AVgRiZnQWm2d//VC+WyM3c j0FxWEjJwsq3Wu4FALQsCFilmjz7cW/OzFnXyFqLnduuaCau7UaRoTFg8zp7BQj0FPjQ ivtN05qYjKKs/jSSmXBln0GJ+gdb+g44FAiA6f2rQnMPUZH4hRMg+qg8IMTxHWJFOtu7 X/dQ== 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 j28-v6si591161pfe.337.2018.05.15.11.22.57; Tue, 15 May 2018 11:22:58 -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 S1753577AbeEOSVd (ORCPT + 29 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 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(-) -- 2.7.4 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,