From patchwork Fri Jun 1 16:52:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Salil Mehta X-Patchwork-Id: 137559 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp1178205lji; Fri, 1 Jun 2018 09:54:13 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLo6AjaDF9ap/rn8ZP4TElcw4YPxiLDCAeV2PWvcTqr7mmAvher/UXOTnBSCHIshi/K3sZT X-Received: by 2002:a17:902:9a4b:: with SMTP id x11-v6mr12054912plv.176.1527872053413; Fri, 01 Jun 2018 09:54:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527872053; cv=none; d=google.com; s=arc-20160816; b=yGQd5PAuQ0anwfBTxO8y3mzyX38w18uNpD4NkUHu/WsG6Qndfozjt/U1FtXExyYLOk ZobbzbrM25H1fQ/bviJZ3CNSI5MCsg/IKhAXCfYzBPWbkiJGMGAHJimZp/V+7wDXJIqN vvE4ittakl8wZX4nuUmaGLFB6cltz9o1u18LSSU4Yf5V1Iaubl1iRMrNoU5Wp7ZjUG/d zgUzfpxf3Rg5dT1W9RZCrgvsWBjjsIwMTDmGYBjD9L4aRCiQpbCHDBuCq4svWW8d589X bkiq53IZEDtjka96y2+u/jq9RANzuFRm7n3yNOx06hbV1bJGMsfvFBZgLIlTmam7K5Rs 8clQ== 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=b/AX1HKTtWFGYmO1nwZ9gMqpqop7F4EzH7BwtxHrEdU=; b=akMnsGqK/MMcSFJ35vno5zGg15i5e4nOo/pkldVt34RMiwvPlqmHMYoM2MaMIEOdm1 ET2sTHL1LuVnz/01M5tLfo5nzyJZIZccmrK4swBIipEVJCMTqSDc7VqC0eOmU5H8ec+E 4UowM4dNczKiGPDYfjWF+I1ufzled10JxUCw9syfC6NMRFzyYGYhpDYzTs4Q/qeX1k4S hgudADsUB3aVLf4JMnNDDhk8POhdXKhyPdsTCslnb9LLe5hMb3Y+oEdt/rG4fk1mt5cm +/UVx31FjPrUcZocb2TKB3JF/sfSKfS8YRcAoM25dm+eWVjcxZp8Il2Dve7Mv7mpM6Vr ssJQ== 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 s13-v6si38877616plq.464.2018.06.01.09.54.13; Fri, 01 Jun 2018 09:54:13 -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 S1753343AbeFAQyL (ORCPT + 30 others); Fri, 1 Jun 2018 12:54:11 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:8627 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753273AbeFAQyG (ORCPT ); Fri, 1 Jun 2018 12:54:06 -0400 Received: from DGGEMS401-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 72DC1820B9F31; Sat, 2 Jun 2018 00:53:46 +0800 (CST) Received: from S00293818-DELL1.china.huawei.com (10.202.227.234) by DGGEMS401-HUB.china.huawei.com (10.3.19.201) with Microsoft SMTP Server id 14.3.382.0; Sat, 2 Jun 2018 00:53:40 +0800 From: Salil Mehta To: CC: , , , , , , , Yunsheng Lin Subject: [PATCH net-next 05/11] net: hns3: Fix for service_task not running problem after resetting Date: Fri, 1 Jun 2018 17:52:05 +0100 Message-ID: <20180601165211.46372-6-salil.mehta@huawei.com> X-Mailer: git-send-email 2.8.3 In-Reply-To: <20180601165211.46372-1-salil.mehta@huawei.com> References: <20180601165211.46372-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_stop is called during resetting, it will cancel the service_task by calling cancel_work_sync, which may cause the service_task to exit without clearing HCLGE_STATE_SERVICE_SCHED bit. If this happens, the service_task will never run again. This patch fixes this problem by clearing it after calling cancel_work_sync in hclge_ae_stop. 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 | 1 + drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c | 1 + 2 files changed, 2 insertions(+) -- 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 18027bc..746987f 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c @@ -3748,6 +3748,7 @@ static void hclge_ae_stop(struct hnae3_handle *handle) del_timer_sync(&hdev->service_timer); cancel_work_sync(&hdev->service_task); + clear_bit(HCLGE_STATE_SERVICE_SCHED, &hdev->state); if (test_bit(HCLGE_STATE_RST_HANDLING, &hdev->state)) return; diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c index e28e0db..5d28052 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c @@ -1337,6 +1337,7 @@ static void hclgevf_ae_stop(struct hnae3_handle *handle) hclgevf_reset_tqp_stats(handle); del_timer_sync(&hdev->service_timer); cancel_work_sync(&hdev->service_task); + clear_bit(HCLGEVF_STATE_SERVICE_SCHED, &hdev->state); hclgevf_update_link_status(hdev, 0); }