Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp704154pxb; Mon, 25 Oct 2021 17:02:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzLGFC2UWeni/2Z7082g2xIewA1YEqH5zylJMGzToK8kpQZQBsFPadGF3iAtsACFKafFDV9 X-Received: by 2002:a50:becf:: with SMTP id e15mr31895203edk.114.1635206559807; Mon, 25 Oct 2021 17:02:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635206559; cv=none; d=google.com; s=arc-20160816; b=jvdukoesY80aPc8p2wVkwtieu4ivRJ4LKA0+RBrZa8A9yp7ggpg/Ba9Lwz9grJHqH4 z2EHUxE2jhaa9pD6M5z1F7HTpEwdo5B3sloSfyJ5rz1l3wW3Z6HbiGQvyqqxfifrrB31 PJBCWvHoJyaFbQjIDUyJ54zm32duIknEmeYnXcA+8oXfqSHIFonOS4Lw07ctmk7/yZol Ox4ULk9nJKaxzYJcu1pP6KBPICmgrRJ7jER9NOzXqN1/aoPBoT0WpyYM2cMYRtA7eCIR h5x/gKfngCs/eCje0WmXoRLPlRLraTqC8irCokqzRc55ThrA0s15NQkFV4J1akjKgIaD oVog== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=rnmVy5CyNT1w9G1ZZZ/jBcQuYzKQvNmnnqKUw6OB+8U=; b=AUhdGkiMuotYzYPEG359m13ZQ0alvKVMQwHMioor3o2MDmvHzNoRgKgg4OibsUSyFx ILJh3xsidOOQFQZ2hJlvRvi6M+T03Aoe91KhR3Y3vyPhUuvNFLlR82Coy0q/CcwbOWej 9u0by7wlxiDy+w6dCSxIFSa8cbGyHSquPJ1kM+IicLdE8fhfCNUZayQVa7SHlN6cGH3l uetZPcde+vvqPL+kFMlfBKqv0G5A5ob9FtGwFQ+ODiBIbb0lndR3eF3eXLttYOlcWfRq bcWv0Z7J/D2H98xUQRon+LyYWzvVUOZ1aRghTJIy4ZVCgsAie/yI/JBhn300GDFzJP2f ozxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=YLDTfXVt; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hd43si14808776ejc.433.2021.10.25.17.02.02; Mon, 25 Oct 2021 17:02:39 -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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=YLDTfXVt; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235410AbhJYTmO (ORCPT + 99 others); Mon, 25 Oct 2021 15:42:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:53862 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236640AbhJYTfB (ORCPT ); Mon, 25 Oct 2021 15:35:01 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id E27496112F; Mon, 25 Oct 2021 19:31:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1635190317; bh=Jb6Kh4rTiM3gtUjlA5XIm/ee8sX1QmV616xtfBG+Qr4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YLDTfXVtEpCNqTYln+dqO3aOKwBDJC3JSH92HXSNILQ5BUeiLC0c+lGux01Rfaobx R5290QAS+qpc6XmeyK3VR35FH6Z13hVGiY54AgKnvYUom/PfAs2DBKLhh5hWeckg4R zAPND/HF2ShrFdwxi4n32JYbDgdWgoUKuM2fDSNs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Yufeng Mo , Guangbin Huang , "David S. Miller" , Sasha Levin Subject: [PATCH 5.10 27/95] net: hns3: fix vf reset workqueue cannot exit Date: Mon, 25 Oct 2021 21:14:24 +0200 Message-Id: <20211025191000.826832400@linuxfoundation.org> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211025190956.374447057@linuxfoundation.org> References: <20211025190956.374447057@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Yufeng Mo [ Upstream commit 1385cc81baeb3bd8cbbbcdc1557f038ac1712529 ] 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 Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- 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 3641d7c31451..a47f23f27a11 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c @@ -2160,9 +2160,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