Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp38492431rwd; Wed, 12 Jul 2023 08:21:19 -0700 (PDT) X-Google-Smtp-Source: APBJJlHZxteB9Suio1xpY7M6zZ9sw6zbFWnVk465wpIYQK+kCURgz4oGk5eY0Yy7L1qlJjPVWWhO X-Received: by 2002:aa7:db92:0:b0:51d:a4b1:d430 with SMTP id u18-20020aa7db92000000b0051da4b1d430mr17366146edt.3.1689175278894; Wed, 12 Jul 2023 08:21:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689175278; cv=none; d=google.com; s=arc-20160816; b=AqjOCWNVL2Uttn2r0Z44TgP3d334LkIfIvvlxKKJlk7RxrOkTZ9zKMCTZTH59rfjFL ZNiaN2o1eXryizwvvqqbmbLBCJf7Q7nWERjSMpmHbArvzQq3QwC7PZUR8EKhRDuSewhk pE7cuEXiTcn9mcYkYZRmoZHTCdaEe1RAgIfPcK1Na5uJf15oe7r7S61U5CNdtzW6/tnW uNgQz9E53Qyiz+dK3VOFTgjf8AEk7wEYLRT/hWwbWiJSc2QFpB6MjlG7cxLPB+efmRwa 4zkRPkimPtd/uQ+/G14X163nzCJupX1SIrOXKwvrb5Pv5jp2gt6l9EuIUszNsNv+BTpy Go2A== 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=19RqjSytoSAaNF5vJ5u7rvCy33n2ldOxYgnlOW3/8NE=; fh=GOsgxbxRSArVVaSo3RPfQW83VyLcLPzNILXiziSRlTw=; b=cyjxxUFkubb8Tlx8hSKLK99wRrECPmuiL2ciLxjp1P/mIXgrwYCl6eYXhFlFhmz1bt hVRkfwIcnmCOcYREj4IhIY7S4D42I46wdtrqJNFpQYYTMYvWP8nHoX4F+4FgdvijXOKc CrYEraxrQObGo08Wuu/X2XjiSjInRtY/TKDMK7GqgXmunoOO4RjwGpRvvnmAkCbyuQrD 9tloflE4n/sSkdM+svreF4rVe4uGIpJqorOlblhv8IPO70tKJ7QnUPKPmIBTfY5E+mc3 1YsRys8+xbaR5rRtyS8u56V8N4Jqowq8e/0Aze2Zi234HF/x3UmoMP5n9RL7QCpuJWrN vgOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=fskZKUks; 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=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f4-20020a056402068400b0051de479c0fesi4653330edy.265.2023.07.12.08.20.54; Wed, 12 Jul 2023 08:21:18 -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=@linuxfoundation.org header.s=korg header.b=fskZKUks; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232984AbjGLPLV (ORCPT + 99 others); Wed, 12 Jul 2023 11:11:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60516 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233394AbjGLPLS (ORCPT ); Wed, 12 Jul 2023 11:11:18 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 78FD51BF9 for ; Wed, 12 Jul 2023 08:11:12 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 7B570616F9 for ; Wed, 12 Jul 2023 15:11:11 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 732A2C433C9; Wed, 12 Jul 2023 15:11:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1689174670; bh=14O7n2R2+7nNC4LbsLJJcewFwSSDuHOWK7ERMRXoOZI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=fskZKUksnspUBCgemFrZDIWNaDnzIfkZgYFHwYXYknfNl6jXAkpKSaFh7K+jPWXNP 3CyzEHMtfIhJo/ZnBtE9Cfoc8kkiK68ONECk/c1OUb5tGxKzGtLB2K6IOA2nin+4jn 6njFOAyI9H+1QgSHFqX+BB9fBXFoZcOrhtkgH/aI= Date: Wed, 12 Jul 2023 17:11:06 +0200 From: Greg KH To: "Gangurde, Abhijit" Cc: "linux-kernel@vger.kernel.org" , "Gupta, Nipun" , "Agarwal, Nikhil" , "Gupta, Puneet (DCG-ENG)" , "git (AMD-Xilinx)" , "Simek, Michal" , "Jansen Van Vuuren, Pieter" Subject: Re: [PATCH 3/4] cdx: create sysfs resource files Message-ID: <2023071231-drinking-unskilled-3c00@gregkh> References: <20230711121027.936487-1-abhijit.gangurde@amd.com> <20230711121027.936487-4-abhijit.gangurde@amd.com> <2023071148-grievance-gulf-0841@gregkh> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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_PASS,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 On Wed, Jul 12, 2023 at 01:23:28PM +0000, Gangurde, Abhijit wrote: > [AMD Official Use Only - General] > > > > Resource files provides the basic MMIO regions info to the > > > user-space. Also, resources devices can be used to mmap the > > > MMIO regions in the user-space. > > > > > > Co-developed-by: Puneet Gupta > > > Signed-off-by: Puneet Gupta > > > Co-developed-by: Nipun Gupta > > > Signed-off-by: Nipun Gupta > > > Signed-off-by: Abhijit Gangurde > > > Reviewed-by: Pieter Jansen van Vuuren > vuuren@amd.com> > > > Tested-by: Nikhil Agarwal > > > --- > > > Documentation/ABI/testing/sysfs-bus-cdx | 15 +++ > > > drivers/cdx/cdx.c | 139 +++++++++++++++++++++++- > > > include/linux/cdx/cdx_bus.h | 10 ++ > > > 3 files changed, 163 insertions(+), 1 deletion(-) > > > > > > diff --git a/Documentation/ABI/testing/sysfs-bus-cdx > > b/Documentation/ABI/testing/sysfs-bus-cdx > > > index d9e00058471d..6ca47b6442ce 100644 > > > --- a/Documentation/ABI/testing/sysfs-bus-cdx > > > +++ b/Documentation/ABI/testing/sysfs-bus-cdx > > > @@ -76,3 +76,18 @@ Description: > > > For example:: > > > > > > # echo 1 > /sys/bus/cdx/devices/.../remove > > > + > > > +What: /sys/bus/cdx/devices/.../resource > > > +Date: July 2023 > > > +Contact: puneet.gupta@amd.com > > > +Description: > > > + The resource file contains host addresses of CDX device > > > + resources. Each line of the resource file describes a region > > > + with start, end, and flag fields. > > > > If you documented what this file looked like here, it would be obvious > > that this is not an acceptable sysfs file in any sense of the word. > > > > Please do so, and then fix the patch to not do that at all. > > Similar interface exist for pci and we intended to keep it same way. Could you please elaborate on this. > > # cat /sys/bus/pci/devices/0000\:01\:00.0/resource > 0x0000000092100000 0x00000000921fffff 0x000000000014220c > 0x0000000000000000 0x0000000000000000 0x0000000000000000 Please don't propagate incorrect decisions in the past. Why do you need all of these "resources" in userspace? What tool is going to read and parse them and do something with them? This really violates the "one value per file" sysfs rule, you are going to have to have a huge reason why this is not applicable here, AND you are going to have to document it very very well and get everyone to agree with it. thanks, greg k-h