Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp810869imm; Fri, 1 Jun 2018 09:56:31 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKXLpRQyFHPp5Uqgcsrwi9Gnai7qGNEnqtNsj8QPIkqzZzm3m5Zd5EPEua0wPYoKqXEHDV7 X-Received: by 2002:a65:51c4:: with SMTP id i4-v6mr9425557pgq.190.1527872191114; Fri, 01 Jun 2018 09:56:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527872191; cv=none; d=google.com; s=arc-20160816; b=JJwNH9ZYUy3w/C057jwZtGa+pwrpUBP/pBoEiRK2SxRveIMjBYq1fKxRbI+PZOGu4S 7YEa95mrjNunwChyd8nS7ItajLWTHnOjBM7wP0ffTqRvH8rjh8sBtfQ01JaSXhTaTDPw I9POIftAgvM/RPo5pmJWPDKek+JOoqVbjAUhdUlGELR1S4RF4isVd3TY5/w7rWePas1I VFmf2hKX31MNCMEcguQX3shX7dqfrGpyG4yEXNb4zf56maSaHYFJDGoyoHRgII5HgrJw Ld3rCWpgtBvC7fJhU81WtXfpbVoiX5bVnIgqrp07/7f864kyKFdAF9wpAyo56glfNnNh p0gw== 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 a3-v6si27561839pgc.300.2018.06.01.09.56.17; Fri, 01 Jun 2018 09:56:31 -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 S1753336AbeFAQyK (ORCPT + 99 others); Fri, 1 Jun 2018 12:54:10 -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 Content-Type: text/plain 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(+) 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); } -- 2.7.4