Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3617469pxk; Mon, 7 Sep 2020 20:03:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwS9WWNMbQ9ooru+9md7JeIsyD1YZaZ6msSS9GhfW3llSM4oKslKrvph5ZLUK2EW2fISZdX X-Received: by 2002:a05:6402:17b6:: with SMTP id j22mr23627376edy.377.1599534226714; Mon, 07 Sep 2020 20:03:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599534226; cv=none; d=google.com; s=arc-20160816; b=noSkKgK7Mzxjh77NLTxUzX0XHjmb9Hi8ZUveyS03Zxi58Fh0wc1YxA7IMf/7VUawlA eS0zlFTsZlU7OkhcKRbVwtGpzoVALhWkKZuh64taVKS1bd6FRRycWtAGVSOXmYNMV6kM V8g6Xt5+yGmSKOfaBjB1qwvK1f9ECwBBSTXMlhhQQbXGlu/HOWyHeJrZHOlTmGGidp0s KhT3jlrCx4mWaZVSIhh8gv28uSxiR/wiAbyj7dedc9QpNFT2d6eLvnuZ5hoYMeF392sd LnGeiGeiuYOZQGEl2k36on0CMkRzHuh279aDGRYW1LBLVjwJeKUoZl58lpph20MQyZsD TN/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; bh=ANIi1kdptDjW4uEtx0cM6KaRsm16+DlU+XSkESh1QSk=; b=bv9SLyu67+vEvsmuyIHZBAQxvFteGgzKuSnxD9sbf7SYfTmVVDw+XrcCz5F75E7H5S 17mAuhGoyCtihDUptjS3KD+0l6CpoefsCilljm6YCrCzMwt+WClNXDTfsMosOZpKq1lm 0ZnQiaKPQ0jYoaeCk2jRyNQubMQOBgXF1kwBBtrZvdd2AsmzYhTS7exquHxj3FIqaqDJ HJifuekTpD2Pikpp3L9QF/uUCKFitBEAD819s6Vr4V4vVF19GM/2QmjXvE4ecabh+GWQ 9OReP3OYBi7FMhTNoBOzQi9gxpbOrVVJqzqyhBGt7oBoeF6n/2H6DdWBCYBxTp3NHcmg Fn2Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gj16si1837282ejb.382.2020.09.07.20.03.24; Mon, 07 Sep 2020 20:03:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728565AbgIHDCo (ORCPT + 99 others); Mon, 7 Sep 2020 23:02:44 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:11256 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728470AbgIHDCc (ORCPT ); Mon, 7 Sep 2020 23:02:32 -0400 Received: from DGGEMS403-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id B38739E199F4AEA5642F; Tue, 8 Sep 2020 11:02:27 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by DGGEMS403-HUB.china.huawei.com (10.3.19.203) with Microsoft SMTP Server id 14.3.487.0; Tue, 8 Sep 2020 11:02:19 +0800 From: Huazhong Tan To: CC: , , , , , , Guangbin Huang , Huazhong Tan Subject: [PATCH net-next 2/7] net: hns3: skip periodic service task if reset failed Date: Tue, 8 Sep 2020 10:59:49 +0800 Message-ID: <1599533994-32744-3-git-send-email-tanhuazhong@huawei.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1599533994-32744-1-git-send-email-tanhuazhong@huawei.com> References: <1599533994-32744-1-git-send-email-tanhuazhong@huawei.com> 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: Guangbin Huang When reset fails, if there are some pending jobs for the periodic service task, it does not do anything except print error each time the task is scheduled. So skip the periodic service task if reset failed. Signed-off-by: Guangbin Huang Signed-off-by: Huazhong Tan --- 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 d553ed7..40d68a4 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c @@ -3944,6 +3944,9 @@ static void hclge_periodic_service_task(struct hclge_dev *hdev) { unsigned long delta = round_jiffies_relative(HZ); + if (test_bit(HCLGE_STATE_RST_FAIL, &hdev->state)) + return; + /* Always handle the link updating to make sure link state is * updated when it is triggered by mbx. */ diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c index 20dd04c..20dd50d 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c @@ -2186,6 +2186,9 @@ static void hclgevf_periodic_service_task(struct hclgevf_dev *hdev) unsigned long delta = round_jiffies_relative(HZ); struct hnae3_handle *handle = &hdev->nic; + if (test_bit(HCLGEVF_STATE_RST_FAIL, &hdev->state)) + return; + if (time_is_after_jiffies(hdev->last_serv_processed + HZ)) { delta = jiffies - hdev->last_serv_processed; -- 2.7.4