Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp269129rwp; Wed, 12 Jul 2023 13:02:51 -0700 (PDT) X-Google-Smtp-Source: APBJJlFrNenGFXclMpQck9rEoUAEVDCnuKrMlt6ZSb0/Hs9aDRN+GfePl0HpdEU5/JSrLPSJp9kO X-Received: by 2002:a17:907:6d05:b0:98d:abd4:4000 with SMTP id sa5-20020a1709076d0500b0098dabd44000mr3989369ejc.35.1689192171336; Wed, 12 Jul 2023 13:02:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689192171; cv=none; d=google.com; s=arc-20160816; b=kW85qdYFwE+H7BTdiBiGw93+usbaaqe4ib8wNbwTeQ5VGeLK4zCbddOg31EypUJKIp 6bXkNdTqV+QAQXOvrmKYNWRhKm6SqP7Kx/dTf3GqGES8KAxAXf4z3cE11lLNWpS4+yMZ ryKrJgCboN94e/ESVn9eMIshE8m4yxsxxwW2zGbRifq6KNxckE3pSC4CpOc+d2wicyv1 zaMxtJ71eGbj2kWyAycpVyM2Hu8OYg8U2tiDlMV8/sk10h3ImQayiyhJ2DXS6kFMvM2z bwmOefQvzzvj07GglFwuSR3INWwah1U+s3eWZ7He0n4dcbC6p+8QCWn+lg96AWkSCPaR f+Kg== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=K02JU+FjloUfrnyaalbvCO4YtVc/9UdxaaBvRCZ/WJU=; fh=Y4N0eDKPElZOeGQE4q3Y9U5zoSjvt8HiQYvhFDMLD1M=; b=mby9bOvPzCA+34oXW/KLvFfeXvNQ/+iENfHXecNV352GHOOwk0+rvHb/AhborAL5kb n/hUFo2yC4NlmlC7cXB0x3088J2mmD6OVIDEOsuivL0fKIIuAg7fCJJb9vsAecAwLbXU 2BSJqdMSKLC4npELiGCLZMyUYAkJ40UqwWzo6RcYYqYt/1eEqcVQcB7S01zs+OAVC5CX lMBKodNJrbeqqqti1Iy9rIZjBGksCOQmiFg8a1cMN4rkOkU4XI2IYX81lJE7Nw5PUNji b+BAXx2O/oRdZBGaDS0q1G4EyN1GDDICSKAgoUP8XLdvAsctLegvoQGxih51zFndbMbK ix7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=enYGmwEy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i3-20020a1709063c4300b00988e963c3adsi5260659ejg.755.2023.07.12.13.02.26; Wed, 12 Jul 2023 13:02:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=enYGmwEy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231977AbjGLTez (ORCPT + 99 others); Wed, 12 Jul 2023 15:34:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59460 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231742AbjGLTew (ORCPT ); Wed, 12 Jul 2023 15:34:52 -0400 Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0E0321FC3; Wed, 12 Jul 2023 12:34:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1689190492; x=1720726492; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=LI93rXYaddJNOOadSd3NS7WZJhub/0fU7emp27bnnyU=; b=enYGmwEyk4b5oHbI2+FEx4wEUqJOiXi3lo/PAtpiz+9vNcsRmMg1ugsb NicuDjsMES8ArKNsLIhfObFxOgXkbCN5a/UhM2kFaceh8WKMgN1zo1UMh 38PGrKsYgEJixySICBHyS7IGVhT+lOmrvNpoA2YWyKkcKpaAWByStQV8g B2jaK39bTA5Yd0za+6Rtq0C1a7yetyhPOsVte4/ALmTmmnXpxjoz4VbIM 2MH8LRMk9/Kb1mOjdDEfOB27UdNtTKxuDkNPhk9+Ca8VrIjOOgvD8bD0T 5DWViG0LLYI7R8JEKBANcgtbGOoDrC5mAH/0W1LNq1bgKyEqr26qmCQb5 g==; X-IronPort-AV: E=McAfee;i="6600,9927,10769"; a="428729178" X-IronPort-AV: E=Sophos;i="6.01,200,1684825200"; d="scan'208";a="428729178" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Jul 2023 12:34:51 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10769"; a="791740274" X-IronPort-AV: E=Sophos;i="6.01,200,1684825200"; d="scan'208";a="791740274" Received: from fyu1.sc.intel.com ([172.25.103.126]) by fmsmga004.fm.intel.com with ESMTP; 12 Jul 2023 12:34:50 -0700 From: Fenghua Yu To: "Vinod Koul" , "Dave Jiang" Cc: dmaengine@vger.kernel.org, "linux-kernel" , Fenghua Yu , Tony Zhu Subject: [PATCH v3] dmaengine: idxd: Clear PRS disable flag when disabling IDXD device Date: Wed, 12 Jul 2023 12:35:05 -0700 Message-Id: <20230712193505.3440752-1-fenghua.yu@intel.com> X-Mailer: git-send-email 2.37.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham 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 Disabling IDXD device doesn't reset Page Request Service (PRS) disable flag to its initial value 0. This may cause user confusion because once PRS is disabled user will see PRS still remains the previous setting (i.e. disabled) via sysfs interface even after the device is disabled. To eliminate user confusion, reset PRS disable flag to ensure that the PRS flag bit reflects correct state after the device is disabled. Additionally, simplify the code by setting wq->flags to 0, which clears all flag bits, including any future additions. Fixes: f2dc327131b5 ("dmaengine: idxd: add per wq PRS disable") Tested-by: Tony Zhu Signed-off-by: Fenghua Yu --- v3: - Add "Fixes" tag. - Set wq->flags to 0. v2: - Fix Tony's email typo drivers/dma/idxd/device.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/dma/idxd/device.c b/drivers/dma/idxd/device.c index 5abbcc61c528..9a15f0d12c79 100644 --- a/drivers/dma/idxd/device.c +++ b/drivers/dma/idxd/device.c @@ -384,9 +384,7 @@ static void idxd_wq_disable_cleanup(struct idxd_wq *wq) wq->threshold = 0; wq->priority = 0; wq->enqcmds_retries = IDXD_ENQCMDS_RETRIES; - clear_bit(WQ_FLAG_DEDICATED, &wq->flags); - clear_bit(WQ_FLAG_BLOCK_ON_FAULT, &wq->flags); - clear_bit(WQ_FLAG_ATS_DISABLE, &wq->flags); + wq->flags = 0; memset(wq->name, 0, WQ_NAME_SIZE); wq->max_xfer_bytes = WQ_DEFAULT_MAX_XFER; idxd_wq_set_max_batch_size(idxd->data->type, wq, WQ_DEFAULT_MAX_BATCH); -- 2.37.1