[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Yybz4j+Uz+aH7uT+@kroah.com>
Date: Sun, 18 Sep 2022 12:33:06 +0200
From: Greg KH <gregkh@...uxfoundation.org>
To: Jiho Chu <jiho.chu@...sung.com>
Cc: arnd@...db.de, ogabbay@...nel.org, krzysztof.kozlowski@...aro.org,
broonie@...nel.org, linux-kernel@...r.kernel.org,
yelini.jeong@...sung.com, myungjoo.ham@...sung.com
Subject: Re: [PATCH v2 07/13] trinity: Add sysfs module
On Sat, Sep 17, 2022 at 04:23:50PM +0900, Jiho Chu wrote:
> This patch includes sysfs interfaces.
>
> sysfs interface provides NPU's internal statistics, status and control
> attribes.
>
> The sysfs information provided by the Trinity are:
> - IDU version
> - profiling result
> - allocated debugfs buffer
>
> The control attributes are including:
> - initialize profile operation
> - NPU control (suspend/resume/stop)
>
> Signed-off-by: Jiho Chu <jiho.chu@...sung.com>
> Signed-off-by: Yelin Jeong <yelini.jeong@...sung.com>
> Signed-off-by: Dongju Chae <dongju.chae@...sung.com>
> Signed-off-by: MyungJoo Ham <myungjoo.ham@...sung.com>
> ---
> .../ABI/testing/sysfs-driver-trinity | 55 ++
> drivers/misc/trinity/Makefile | 1 +
> drivers/misc/trinity/trinity_sysfs.c | 667 ++++++++++++++++++
> 3 files changed, 723 insertions(+)
> create mode 100644 Documentation/ABI/testing/sysfs-driver-trinity
> create mode 100644 drivers/misc/trinity/trinity_sysfs.c
>
> diff --git a/Documentation/ABI/testing/sysfs-driver-trinity b/Documentation/ABI/testing/sysfs-driver-trinity
> new file mode 100644
> index 000000000000..754e6f36a1dc
> --- /dev/null
> +++ b/Documentation/ABI/testing/sysfs-driver-trinity
> @@ -0,0 +1,55 @@
> +What: /sys/devices/platform/trinity/*.triv2/debug/debugfs_max
> +Date: July 2022
> +KernelVersion: 5.19-rc8
> +Contact: Jiho Chu <jiho.chu@...sung.com>
> +Description: Shows current allocated debugfs entry size.
> + Note that, Writing max entry size allocates NPU's hardware
> + memory for debugfs entries.
Why are debugfs things being mentioned in sysfs entries?
That's not needed, nor is it allowed, sorry.
Please put all debugfs stuff in debugfs.
Also, sysfs is "one value per file", you violate that in lots of ways
with this patch. Please fix all of that, and use the sysfs_emit() calls
instead of snprintf() for your sysfs show calls.
thanks,
greg k-h
Powered by blists - more mailing lists