From nobody Fri Apr 3 03:54:25 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 328FBC6FA82 for ; Sat, 17 Sep 2022 16:13:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229517AbiIQQNV (ORCPT ); Sat, 17 Sep 2022 12:13:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38840 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229524AbiIQQNS (ORCPT ); Sat, 17 Sep 2022 12:13:18 -0400 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 36DEE2ED66; Sat, 17 Sep 2022 09:13:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1663431197; x=1694967197; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=HBWIwAR8yMUB4JUk2toz1ESMY37zb0vzYAO7ctg9dKM=; b=KiNfHuJ2+da+RZOcboN9BzVA4WUWm2TCqsUncE7b3SKzTjkZQpGv8Yeo 2h5Oap9eXkXF1r+CX0UFZjXD7cc53TchQGlT+hHIBCAE46A2RMr6bm1iD gnGi1doik2DPhTS+z53mAuNYT3O48vkc89Oz4ZWjqJPCkjPoP5TSDqv54 89dQSXXMsw0mwJcqovuouhZHE7w5NKVC/fIs+oTDNc0as6N/ebSqQCnNY uEoABZ5qJ6npFgGTKNpLdj3BkTUzZwy/nEjLky9DlkpY2yDOSdKQs6NCU 1sN+l4jXvh8ZOhG+sIpEMBMdEzV6rjgImxVu6bj7KuZcVf8HqSQ0kDRhE Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10473"; a="286206511" X-IronPort-AV: E=Sophos;i="5.93,323,1654585200"; d="scan'208";a="286206511" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Sep 2022 09:13:14 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,323,1654585200"; d="scan'208";a="686472598" Received: from fyu1.sc.intel.com ([172.25.103.126]) by fmsmga004.fm.intel.com with ESMTP; 17 Sep 2022 09:13:14 -0700 From: Fenghua Yu To: "Vinod Koul" , "Dave Jiang" Cc: "linux-kernel" , dmaengine@vger.kernel.org, Fenghua Yu Subject: [PATCH 1/5] dmaengine: idxd: convert ats_dis to a wq flag Date: Sat, 17 Sep 2022 09:12:18 -0700 Message-Id: <20220917161222.2835172-2-fenghua.yu@intel.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220917161222.2835172-1-fenghua.yu@intel.com> References: <20220917161222.2835172-1-fenghua.yu@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Dave Jiang Make wq attributes access consistent. Convert ats_dis to wq flag WQ_FLAG_ATS_DISABLE. Signed-off-by: Dave Jiang Co-developed-by: Fenghua Yu Signed-off-by: Fenghua Yu --- drivers/dma/idxd/device.c | 4 ++-- drivers/dma/idxd/idxd.h | 2 +- drivers/dma/idxd/sysfs.c | 7 +++++-- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/dma/idxd/device.c b/drivers/dma/idxd/device.c index 5a8cc52c1abf..bbc3c8b9a10f 100644 --- a/drivers/dma/idxd/device.c +++ b/drivers/dma/idxd/device.c @@ -382,10 +382,10 @@ static void idxd_wq_disable_cleanup(struct idxd_wq *w= q) wq->type =3D IDXD_WQT_NONE; wq->threshold =3D 0; wq->priority =3D 0; - wq->ats_dis =3D 0; wq->enqcmds_retries =3D 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); memset(wq->name, 0, WQ_NAME_SIZE); wq->max_xfer_bytes =3D WQ_DEFAULT_MAX_XFER; wq->max_batch_size =3D WQ_DEFAULT_MAX_BATCH; @@ -859,7 +859,7 @@ static int idxd_wq_config_write(struct idxd_wq *wq) wq->wqcfg->bof =3D 1; =20 if (idxd->hw.wq_cap.wq_ats_support) - wq->wqcfg->wq_ats_disable =3D wq->ats_dis; + wq->wqcfg->wq_ats_disable =3D test_bit(WQ_FLAG_ATS_DISABLE, &wq->flags); =20 /* bytes 12-15 */ wq->wqcfg->max_xfer_shift =3D ilog2(wq->max_xfer_bytes); diff --git a/drivers/dma/idxd/idxd.h b/drivers/dma/idxd/idxd.h index fed0dfc1eaa8..cda856bfc22a 100644 --- a/drivers/dma/idxd/idxd.h +++ b/drivers/dma/idxd/idxd.h @@ -132,6 +132,7 @@ enum idxd_wq_state { enum idxd_wq_flag { WQ_FLAG_DEDICATED =3D 0, WQ_FLAG_BLOCK_ON_FAULT, + WQ_FLAG_ATS_DISABLE, }; =20 enum idxd_wq_type { @@ -208,7 +209,6 @@ struct idxd_wq { char name[WQ_NAME_SIZE + 1]; u64 max_xfer_bytes; u32 max_batch_size; - bool ats_dis; }; =20 struct idxd_engine { diff --git a/drivers/dma/idxd/sysfs.c b/drivers/dma/idxd/sysfs.c index 3f262a57441b..be9ff9d4cc4b 100644 --- a/drivers/dma/idxd/sysfs.c +++ b/drivers/dma/idxd/sysfs.c @@ -973,7 +973,7 @@ static ssize_t wq_ats_disable_show(struct device *dev, = struct device_attribute * { struct idxd_wq *wq =3D confdev_to_wq(dev); =20 - return sysfs_emit(buf, "%u\n", wq->ats_dis); + return sysfs_emit(buf, "%u\n", test_bit(WQ_FLAG_ATS_DISABLE, &wq->flags)); } =20 static ssize_t wq_ats_disable_store(struct device *dev, struct device_attr= ibute *attr, @@ -994,7 +994,10 @@ static ssize_t wq_ats_disable_store(struct device *dev= , struct device_attribute if (rc < 0) return rc; =20 - wq->ats_dis =3D ats_dis; + if (ats_dis) + set_bit(WQ_FLAG_ATS_DISABLE, &wq->flags); + else + clear_bit(WQ_FLAG_ATS_DISABLE, &wq->flags); =20 return count; } --=20 2.32.0