Received: by 10.223.185.116 with SMTP id b49csp5789651wrg; Wed, 7 Mar 2018 18:43:50 -0800 (PST) X-Google-Smtp-Source: AG47ELtmuVkLCJbwb91WIF7HImrElQ1TnoM9vLaJCiVCP7ib4hjWY/QJZpHixHTDp1NHAa7saJGj X-Received: by 10.167.129.129 with SMTP id g1mr24655197pfi.224.1520477030749; Wed, 07 Mar 2018 18:43:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520477030; cv=none; d=google.com; s=arc-20160816; b=hfGMTG2EF5M7dulEpLv3PvH43MuxYnfsUjphG9lCj3wJqAisLDYBTApxhECuZARxU0 YhRB+hneNVJHQMHj9LkqPHTKk9iF6m6fQBjqNdV09aerPXOmXEPUpG/nDrmlSjfsVpsV rnf+0IKEHChuru9yR/sJUnteFWaP6lj1l4Wer5rmquukbak0mhgYwLhpKS6i9YaU32FW M0MCFSeXIz4r7z7Ho6unBfaH0COSeZLhYJlvr69U6In5/zonreIdLr8dIxWUuMbUNfQI 2cIYJrmj5L1hvujb04XqLjzt1ieuwMHOh2rneT14RLfqMVmLTIAYostJ4cp+nz1bBaDb PPpQ== 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=EFNH959PhJUKM674W+Au1OTOIQ9290u8CJk+22abqK8=; b=SIsNAh7C1dB+M8Jynl+3SDoiXO1K8qYjcu/DMqr3+gOZ0x2tnDWpAu0aQJRbPfNLtJ 7HAnZq3iDvaczBl0wnnpRIH+yLjAAO7H4PN4Pr7jcE92uWeravuyW4w65mM1PX22Vnbt 7g97n8zhSaeMwGkQoGx1+cbQuFIpwEK1xnesFGucLumKMXExZjOZ/VII1xdWYBlShdvN AIS1fMTg5MrEE/Ra5xwmkdQDMNURc56tzDS6VQM/vIhUPSypCdNqWR9UM5pVJVG+rK05 NGENlOqsExrWLpQhjswXbDg7Y2ZPlIzvD8/3tOIPTKHKqp5MRh+nYtC/fj4StCIiPeXE Scsw== 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 v21-v6si6412662plo.621.2018.03.07.18.43.35; Wed, 07 Mar 2018 18:43:50 -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 S935035AbeCHCk7 (ORCPT + 99 others); Wed, 7 Mar 2018 21:40:59 -0500 Received: from szxga05-in.huawei.com ([45.249.212.191]:5749 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S934785AbeCHCfA (ORCPT ); Wed, 7 Mar 2018 21:35:00 -0500 Received: from DGGEMS408-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id C54EB687D45; Thu, 8 Mar 2018 10:34:43 +0800 (CST) Received: from linux-ioko.site (10.71.200.31) by DGGEMS408-HUB.china.huawei.com (10.3.19.208) with Microsoft SMTP Server id 14.3.361.1; Thu, 8 Mar 2018 10:34:37 +0800 From: Peng Li To: CC: , , , , Subject: [PATCH net-next 05/23] {topost} net: hns3: fix for netdev not running problem after calling net_stop and net_open Date: Thu, 8 Mar 2018 11:06:30 +0800 Message-ID: <1520478408-116992-6-git-send-email-lipeng321@huawei.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1520478408-116992-1-git-send-email-lipeng321@huawei.com> References: <1520478408-116992-1-git-send-email-lipeng321@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.71.200.31] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Fuyun Liang The link status update function is called by timer every second. But net_stop and net_open may be called with very short intervals. The link status update function can not detect the link state has changed. It causes the netdev not running problem. This patch fixes it by updating the link state in ae_stop function. Signed-off-by: Fuyun Liang Signed-off-by: Peng Li --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 3 +++ drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c | 3 +++ 2 files changed, 6 insertions(+) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c index 0b74461..83be4d5 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c @@ -3770,6 +3770,9 @@ static void hclge_ae_stop(struct hnae3_handle *handle) /* reset tqp stats */ hclge_reset_tqp_stats(handle); + del_timer_sync(&hdev->service_timer); + cancel_work_sync(&hdev->service_task); + hclge_update_link_status(hdev); } static int hclge_get_mac_vlan_cmd_status(struct hclge_vport *vport, diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c index ccb6756..eee5e20 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c @@ -1061,6 +1061,9 @@ static void hclgevf_ae_stop(struct hnae3_handle *handle) /* reset tqp stats */ hclgevf_reset_tqp_stats(handle); + del_timer_sync(&hdev->service_timer); + cancel_work_sync(&hdev->service_task); + hclgevf_update_link_status(hdev, 0); } static void hclgevf_state_init(struct hclgevf_dev *hdev) -- 2.9.3