Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp6427897rwb; Wed, 18 Jan 2023 05:11:27 -0800 (PST) X-Google-Smtp-Source: AMrXdXvnRATwqPhOgZbpnw8zZ2ymqwk+BViXrRHmzFKsB5eJc0QvoK8myj9YFvwFlisAnGI5KMMn X-Received: by 2002:aa7:c0d4:0:b0:49d:9bd8:6253 with SMTP id j20-20020aa7c0d4000000b0049d9bd86253mr7678193edp.17.1674047487057; Wed, 18 Jan 2023 05:11:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674047487; cv=none; d=google.com; s=arc-20160816; b=cTksHVfpV/ss3qbXcye/gggMI3QoWlLAF9wtH2Yx2fedHC2gZy2jyweAdPFQqi+mcl ZS4ycpiii/2Go1TCywzf4KyJhllPgfQZ1UONooYU9XWI1sMXE4eGIWX017tIdL2wLVg/ 0ZkwbsdyEEg6R7YM5Lu9eeeNSdwhpDGdQ43iFF4rqh44oo6tkPGt+xE0lH/TbT1XOiTL Z8Or+1bvGgr0CuMga2j6cAN0cOXvfWmn+NzKdtt66P6dKeN1o1SvQDcPIUaGnGJTQWql LwKUP8Mg10jqqsnOnFuplB1GG0wZFG2dOTSDemNmAH/oWZd6fDjL4ww6T4o6uV8LahsW gShA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=9r/OzEqeh2USbqXjxxEyr38AuOXJ2IgfTLNlA9fNWtU=; b=IYMuJDKKFDc3hk3JG530bcBMPbOLKWmX791CTt+/M9y3Y5vtt1pWk11jPoT75X5Wa9 mCo+TzyebZQGpA3iqtA5mI1gRqsZPs239lPTFbHRwL4fLsC/wHEe7uR/1BqwIfL6/Kpk xXIGcRcmkSsb2VTx9lpUk2ftc/zOHReO3bzrEVF5zcvFQoNFwh90hIuFlf3NUqdsJ2DD 2aeMnfrRasbEOGyGyDBLsYFrGqavMpiDcyu31dRgHB2YlReNCK0zD2xTBIBht+8oj0D+ LMOQ9ezsQbgSCdCvQMWKWWEPxbYzMOiKuR/mvCm9I4of5IxygaX88qhsUVZ/AnBufpWW R1GA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="RPtHVR/Y"; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sb10-20020a1709076d8a00b0086a2cb250d5si12084019ejc.505.2023.01.18.05.11.15; Wed, 18 Jan 2023 05:11:27 -0800 (PST) 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=@kernel.org header.s=k20201202 header.b="RPtHVR/Y"; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230096AbjARMkZ (ORCPT + 45 others); Wed, 18 Jan 2023 07:40:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42002 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230370AbjARMiI (ORCPT ); Wed, 18 Jan 2023 07:38:08 -0500 Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 50F434B1BC; Wed, 18 Jan 2023 04:02:37 -0800 (PST) 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 sin.source.kernel.org (Postfix) with ESMTPS id 74CEFCE1C35; Wed, 18 Jan 2023 12:02:35 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0396FC433D2; Wed, 18 Jan 2023 12:02:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1674043353; bh=4Xca03zRSlvGRCTu93+PKQ1DoyTUuno9kJ8y0NpugwI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=RPtHVR/YK4UMN28qZMbEoTcnPhmInV/4V9edRsb11BNvbtkINkpgnCe4rLbA8/Myp +XXZRgA8YkOKgl/X+CE+NodmxnT9INRKRB8QiPwyloWOfzfV+CV8nTR0579dJc15nX WQPjHNyaT+fQe3pCltpzBiBw89b5/8+9/oHqLQGBWpZYuA0WvhPhBovvIiw4OOpG75 oJu4BJ9Zp4t06IcZVNgzLl4TzkjCIepaY5iK4kbN2fMJXW0qPv+Vw+oHpVNtLsXUKY wGx+rLWLFDakorKpF9h8czOaeu9EBRkDLXRSwTPUNidzvr9JIX6VHhdr/DHqxTXCft nmw7/DxXlQU1A== Date: Wed, 18 Jan 2023 17:32:29 +0530 From: Vinod Koul To: Fenghua Yu Cc: Dave Jiang , dmaengine@vger.kernel.org, linux-kernel Subject: Re: [PATCH 1/2] dmaengine: idxd: reformat swerror output to standard Linux bitmap output Message-ID: References: <20230103165337.1570238-1-fenghua.yu@intel.com> <20230103165337.1570238-2-fenghua.yu@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230103165337.1570238-2-fenghua.yu@intel.com> X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS 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 On 03-01-23, 08:53, Fenghua Yu wrote: > From: Dave Jiang > > SWERROR register is 4 64bit wide registers. Currently the sysfs attribute > just outputs 4 64bit hex integers. Covert to output with %*pb format s/Covert/Convert > specifier. > > Signed-off-by: Dave Jiang > Co-developed-by: Fenghua Yu > Signed-off-by: Fenghua Yu > --- > drivers/dma/idxd/idxd.h | 1 + > drivers/dma/idxd/init.c | 2 +- > drivers/dma/idxd/sysfs.c | 10 ++++------ > 3 files changed, 6 insertions(+), 7 deletions(-) > > diff --git a/drivers/dma/idxd/idxd.h b/drivers/dma/idxd/idxd.h > index f92f8ec83722..e449d905bea3 100644 > --- a/drivers/dma/idxd/idxd.h > +++ b/drivers/dma/idxd/idxd.h > @@ -654,6 +654,7 @@ int idxd_register_driver(void); > void idxd_unregister_driver(void); > void idxd_wqs_quiesce(struct idxd_device *idxd); > bool idxd_queue_int_handle_resubmit(struct idxd_desc *desc); > +void multi_u64_to_bmap(unsigned long *bmap, u64 *val, int count); This change does not belong to this patch, I dont know why this is here > > /* device interrupt control */ > irqreturn_t idxd_misc_thread(int vec, void *data); > diff --git a/drivers/dma/idxd/init.c b/drivers/dma/idxd/init.c > index 564c025b9b7e..996bd3e4e50f 100644 > --- a/drivers/dma/idxd/init.c > +++ b/drivers/dma/idxd/init.c > @@ -425,7 +425,7 @@ static void idxd_read_table_offsets(struct idxd_device *idxd) > dev_dbg(dev, "IDXD Perfmon Offset: %#x\n", idxd->perfmon_offset); > } > > -static void multi_u64_to_bmap(unsigned long *bmap, u64 *val, int count) > +void multi_u64_to_bmap(unsigned long *bmap, u64 *val, int count) > { > int i, j, nr; > > diff --git a/drivers/dma/idxd/sysfs.c b/drivers/dma/idxd/sysfs.c > index c772172d4ceb..dae28509e6ed 100644 > --- a/drivers/dma/idxd/sysfs.c > +++ b/drivers/dma/idxd/sysfs.c > @@ -1506,15 +1506,13 @@ static ssize_t errors_show(struct device *dev, > struct device_attribute *attr, char *buf) > { > struct idxd_device *idxd = confdev_to_idxd(dev); > - int i, out = 0; > + DECLARE_BITMAP(swerr_bmap, 256); > > + bitmap_zero(swerr_bmap, 256); > spin_lock(&idxd->dev_lock); > - for (i = 0; i < 4; i++) > - out += sysfs_emit_at(buf, out, "%#018llx ", idxd->sw_err.bits[i]); > + multi_u64_to_bmap(swerr_bmap, &idxd->sw_err.bits[0], 4); > spin_unlock(&idxd->dev_lock); > - out--; > - out += sysfs_emit_at(buf, out, "\n"); > - return out; > + return sysfs_emit(buf, "%*pb\n", 256, swerr_bmap); > } > static DEVICE_ATTR_RO(errors); > > -- > 2.32.0 -- ~Vinod