Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp507866pxb; Tue, 19 Oct 2021 07:24:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyHvjU7SQbtAv71/B25XZnpZ/P8sa81mtuU0F7mv2Up9Ksv7SvGgGDLUUlXdtqQkNrXzTSF X-Received: by 2002:adf:fa8f:: with SMTP id h15mr44887615wrr.323.1634653467439; Tue, 19 Oct 2021 07:24:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634653467; cv=none; d=google.com; s=arc-20160816; b=mVymy5kPhGGwYXEqRSt0HT/FO8c04UamK9BnE+hE995nuCrTvvjRRIqzuxgzVan70s 9gaeQNQbntYzrS/OUiOkJJfeLCbnAyamMakbaqLdCaa9BmS1XP/Yl5gpnl8pRPTyOgjs b2g8ChA132T9W6bp76gvFbq0Q5SvqZEtpZW9Eu587hX9xKSIKtfUG3ZH1Jk5UhSSRsab UUYfxaz2XOW6pjpG+TqhueOv5LXX2lA4Fhb8VkXnqYTnhsCdGtUGwHqdHLASIhXaPIMc ZMtkFZYhU1RisQtXnIUA9QnRcUzNfG2oNPUJOoAKfZvqnrLGYKiDuCmTKCxhfCY2ijQ3 y1UQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=zURJIqhC8KrWuV711kXTajwDurb9LVxt3QStuYhKkFo=; b=uSgglNQxnYF4HPfdjqksE252vWU41YjzYbKhzCPFBos8RM9TGcJMqHriKukyeBrxfS f075BJtmlC0//d+QYTioilPjkjvMbLYnhHqAIuXESULn/DXLkxsRcmydIZki5VmLgtOX GEOcbtC26pjicLSlqaNrIfsSWU5jWhYRg1I59HnR5WV2sqIeCRKJYpt9I8t7G5QD2hPN 8T8JmrDAM/72c7aoW1BUuSSX5jcix5IXnilKXFGw7Emg7zPHEELV3SZFJMtiOSsniqLz dhaQ0a6p/bFDaA4HrthYwSffE+dk2T03FD0vboi24j5H4vL4jIGHKRCmFzdUVVNmENMG W0Kg== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b20si35804469ede.275.2021.10.19.07.23.59; Tue, 19 Oct 2021 07:24:27 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233839AbhJSOX3 (ORCPT + 99 others); Tue, 19 Oct 2021 10:23:29 -0400 Received: from szxga01-in.huawei.com ([45.249.212.187]:29910 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230168AbhJSOXI (ORCPT ); Tue, 19 Oct 2021 10:23:08 -0400 Received: from dggemv711-chm.china.huawei.com (unknown [172.30.72.55]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4HYbQD54NFzbn8J; Tue, 19 Oct 2021 22:16:20 +0800 (CST) Received: from kwepemm600016.china.huawei.com (7.193.23.20) by dggemv711-chm.china.huawei.com (10.1.198.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.15; Tue, 19 Oct 2021 22:20:53 +0800 Received: from localhost.localdomain (10.67.165.24) by kwepemm600016.china.huawei.com (7.193.23.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.15; Tue, 19 Oct 2021 22:20:53 +0800 From: Guangbin Huang To: , CC: , , , , Subject: [PATCH net 7/8] net: hns3: fix vf reset workqueue cannot exit Date: Tue, 19 Oct 2021 22:16:34 +0800 Message-ID: <20211019141635.43695-8-huangguangbin2@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211019141635.43695-1-huangguangbin2@huawei.com> References: <20211019141635.43695-1-huangguangbin2@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.67.165.24] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To kwepemm600016.china.huawei.com (7.193.23.20) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Yufeng Mo The task of VF reset is performed through the workqueue. It checks the value of hdev->reset_pending to determine whether to exit the loop. However, the value of hdev->reset_pending may also be assigned by the interrupt function hclgevf_misc_irq_handle(), which may cause the loop fail to exit and keep occupying the workqueue. This loop is not necessary, so remove it and the workqueue will be rescheduled if the reset needs to be retried or a new reset occurs. Fixes: 1cc9bc6e5867 ("net: hns3: split hclgevf_reset() into preparing and rebuilding part") Signed-off-by: Yufeng Mo Signed-off-by: Guangbin Huang --- drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c index 5fdac8685f95..bef6b98e2f50 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c @@ -2273,9 +2273,9 @@ static void hclgevf_reset_service_task(struct hclgevf_dev *hdev) hdev->reset_attempts = 0; hdev->last_reset_time = jiffies; - while ((hdev->reset_type = - hclgevf_get_reset_level(hdev, &hdev->reset_pending)) - != HNAE3_NONE_RESET) + hdev->reset_type = + hclgevf_get_reset_level(hdev, &hdev->reset_pending); + if (hdev->reset_type != HNAE3_NONE_RESET) hclgevf_reset(hdev); } else if (test_and_clear_bit(HCLGEVF_RESET_REQUESTED, &hdev->reset_state)) { -- 2.33.0