Received: by 2002:a05:6602:2086:0:0:0:0 with SMTP id a6csp4410255ioa; Wed, 27 Apr 2022 03:18:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxehSLJ1mOfmU4+XQhchKvcNPLaQk+EwkJp7htd8YVGgyGN72ebxSb22DwAna7TiIqwBiY2 X-Received: by 2002:a17:902:ecd2:b0:15b:618a:2a8f with SMTP id a18-20020a170902ecd200b0015b618a2a8fmr27756955plh.140.1651054682960; Wed, 27 Apr 2022 03:18:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651054682; cv=none; d=google.com; s=arc-20160816; b=HmvKkGmrFKmzk5BNwkMmQ9tYMCf9Ed1MrPeDrcN18fljXnkgu64ADHTZgkpVVyOzR0 JU507ibVKakPMsDZ9/MnE+rFNi5cWhUUcYHVKsxTFLfYa1gNSY/TPi9gALFqB4mTgGBQ 1yNxffIqYFgdwv9md/LWdShJyUMQMBSAWsi+O+sC6dexU1XY8sqKamRXM8C1tcB2jjso 1p7gyoyrD4bRZSLvAuIjCzJ+n+ZtH0AmFizlDDgtFGGoz8uMESXErk9PMvNsuYkSDPaE 69NK/qZdW/BGZp1s2KgNG/YsKyNw1OHFc2cNREkEqixCET86ocmS8JWMkKyS/OHkES9p S3AQ== 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=tG9Lxnxekl1T5j3NyhPCujIeFGIJGuwM8MeAOt45cKI=; b=letib2J7ZX0jR+pS+W4bNFP23wOVVVTZGlo693F/IgiQJsPq8G0Wl5rgBC7Op0DKWQ dyvlpcsh40yHg/zzuZLfKYbRuzHvkuv9ySFIDlNI7sI+fhm491sr9of3UojsMHV8dXgb Pwphvz0cX4q2Ofic5lTur3HP642mLAicZAQ8KX+SowULi9XD/Hf6YyXoQcqefZERGgxI awEN/qwCcltVTYLKJhP6kiC1I+SzncDXcwV4ha5wbBBZz9iyEccjA+iR1qKB+v83q2b4 rcfEipIBy7WYbfpFZoVwb6W31dMMw+8qv3bQy4jW3npKMbk7d7/1d9UMxLmMfLI+MHl9 4fXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=h8U5zN+L; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id t13-20020a63954d000000b003aad07d8487si1089406pgn.60.2022.04.27.03.18.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Apr 2022 03:18:02 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=h8U5zN+L; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 4DAA93492E9; Wed, 27 Apr 2022 02:38:18 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241341AbiDZJC6 (ORCPT + 99 others); Tue, 26 Apr 2022 05:02:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55176 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346933AbiDZIpb (ORCPT ); Tue, 26 Apr 2022 04:45:31 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 651603BBFD; Tue, 26 Apr 2022 01:36:52 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id C4624618E8; Tue, 26 Apr 2022 08:36:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C3F4CC385A0; Tue, 26 Apr 2022 08:36:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1650962211; bh=O5cWtjT6oZ9kHdt3jLx0dw74Nywf3PaeWXGX73eSrJs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=h8U5zN+LbLDcyYSiJ0UlwAT9RnmpiKXLmwGc3fFcoK4tDuKbsIQR3hBgS91Hh5huG RNLRc3tqINJqQ/ELBEmkIgEYra/2wibdzMHxsZIEtDPc+X2A8uzoydL+ssEaLvlEnQ wMyFUjyxU5Jv5w/4SLdm68GuwWtxPHU8f0gxgxT8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tony Zhu , Dave Jiang , Vinod Koul , Sasha Levin Subject: [PATCH 5.15 022/124] dmaengine: idxd: fix device cleanup on disable Date: Tue, 26 Apr 2022 10:20:23 +0200 Message-Id: <20220426081747.936081453@linuxfoundation.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220426081747.286685339@linuxfoundation.org> References: <20220426081747.286685339@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dave Jiang [ Upstream commit 12e45e89556d7a532120f976081e9e7582addd2b ] There are certain parts of WQ that needs to be cleaned up even after WQ is disabled during the device disable. Those are the unchangeable parts for a WQ when the device is still enabled. Move the cleanup outside of WQ state check. Remove idxd_wq_disable_cleanup() inside idxd_wq_device_reset_cleanup() since only the unchangeable parts need to be cleared. Fixes: 0f225705cf65 ("dmaengine: idxd: fix wq settings post wq disable") Reported-by: Tony Zhu Tested-by: Tony Zhu Signed-off-by: Dave Jiang Link: https://lore.kernel.org/r/164919561905.1455025.13542366389944678346.stgit@djiang5-desk3.ch.intel.com Signed-off-by: Vinod Koul Signed-off-by: Sasha Levin --- drivers/dma/idxd/device.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/dma/idxd/device.c b/drivers/dma/idxd/device.c index 7bd9ac1e93b2..a67bafc596b7 100644 --- a/drivers/dma/idxd/device.c +++ b/drivers/dma/idxd/device.c @@ -406,7 +406,6 @@ static void idxd_wq_device_reset_cleanup(struct idxd_wq *wq) { lockdep_assert_held(&wq->wq_lock); - idxd_wq_disable_cleanup(wq); wq->size = 0; wq->group = NULL; } @@ -723,9 +722,9 @@ static void idxd_device_wqs_clear_state(struct idxd_device *idxd) if (wq->state == IDXD_WQ_ENABLED) { idxd_wq_disable_cleanup(wq); - idxd_wq_device_reset_cleanup(wq); wq->state = IDXD_WQ_DISABLED; } + idxd_wq_device_reset_cleanup(wq); } } -- 2.35.1