Received: by 10.223.185.111 with SMTP id b44csp1007280wrg; Fri, 9 Mar 2018 19:02:41 -0800 (PST) X-Google-Smtp-Source: AG47ELsI233y4IwqZ4aKr9hOJl2GAxzqJzdQVpV4o6u8Mc0dw1I0v8hPZm4VDzw4O/SSYgvXfqWY X-Received: by 2002:a17:902:b192:: with SMTP id s18-v6mr669113plr.243.1520650961250; Fri, 09 Mar 2018 19:02:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520650961; cv=none; d=google.com; s=arc-20160816; b=Ixt2YiHnxSNDwOYnR/zvvwA3KYBT7cR5Oj4Id4OS6yzd7iBCmGP4AbARCmTIj6wa7Y du2N3K97eA37XkYrrxIXcRyyzBlme1j/ahTbVuCjQTrZFElaDHh3xKTnvFut2JtBWtjM KufIypipsYkJWb1Ao6BHSmJ438fSfiW78VrmI+oyJui5tERE9XO42AxFWMsmcYzQ0Sg+ MrLYVbUtQuP3Bnj+ISvJr/DvDqF2hWUwCGjQKJnchX5bXopH8zZ7c9QUifOKb4VRddae vRkDe4uc7Ycq2IF0BKWoRZeNLpivlWxYUevvnUC393zKWMU1VMXm0Pg3lgo2I4bJMILV l2/A== 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=ZeGdjS3PkdJTffehKt0IxrsvLizpdXnPLP6qJyQ3mTY=; b=VHYpJ53K1IpKMKfSWZCei4+90LWyk4bEMmhXdT8fmAiWAaTBX9fdnBUEnyTafDzjeQ 3d8rgotRGVWatY764k5eU+vvR2rpSLbn63bav2MJoZFAqvFtegn4qn7K/hzdZpgqAdWY Xv4RL24LI7pbjTJa4N+VrZVKCPdnlhjuaLl61oofIFRF/E7RcaOm4I8rl9o34jpLQcxt b9ycd11OQaTJ6IetXVcRyHK1Ydv/6+slZ9vVigz0dkSK/KBQ8KEPbSjBiyAOFepE1t1g dMoM8ez+kgT7vsw6ABHmVuJPst4VUJypwJKKRl9G8qC/EC/QV+qAzeuKEc6EBg62tmtu 2WwA== 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 25si1957690pfp.141.2018.03.09.19.02.26; Fri, 09 Mar 2018 19:02:41 -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 S932912AbeCJDAt (ORCPT + 99 others); Fri, 9 Mar 2018 22:00:49 -0500 Received: from szxga05-in.huawei.com ([45.249.212.191]:6218 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751392AbeCJC5g (ORCPT ); Fri, 9 Mar 2018 21:57:36 -0500 Received: from DGGEMS408-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 4C1C37548F17F; Sat, 10 Mar 2018 10:57:21 +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; Sat, 10 Mar 2018 10:57:15 +0800 From: Peng Li To: CC: , , , , Subject: [PATCH net-next 02/12] net: hns3: fix for netdev not running problem after calling net_stop and net_open Date: Sat, 10 Mar 2018 11:29:23 +0800 Message-ID: <1520652573-75644-3-git-send-email-lipeng321@huawei.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1520652573-75644-1-git-send-email-lipeng321@huawei.com> References: <1520652573-75644-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 632672c..cc60407 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c @@ -3756,6 +3756,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 ba3fed1..c80a604 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c @@ -1066,6 +1066,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