lkml.org 
[lkml]   [2022]   [Sep]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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@samsung.com>
> Signed-off-by: Yelin Jeong <yelini.jeong@samsung.com>
> Signed-off-by: Dongju Chae <dongju.chae@samsung.com>
> Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.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@samsung.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

\
 
 \ /
  Last update: 2022-09-18 12:33    [W:0.053 / U:0.088 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site