From mboxrd@z Thu Jan 1 00:00:00 1970 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 8D434C54EE9 for ; Sun, 18 Sep 2022 10:32:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229593AbiIRKco (ORCPT ); Sun, 18 Sep 2022 06:32:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43860 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229541AbiIRKcl (ORCPT ); Sun, 18 Sep 2022 06:32:41 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D0BCF1C916 for ; Sun, 18 Sep 2022 03:32:40 -0700 (PDT) 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 ams.source.kernel.org (Postfix) with ESMTPS id 85833B80E4C for ; Sun, 18 Sep 2022 10:32:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D1EAEC433D6; Sun, 18 Sep 2022 10:32:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1663497158; bh=I/231C3xrrcoDPvXTfR4QzqxGeYUu8BpzYz0w9jb7YE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=v8ZlC0pPtIIuhPG7vgs+5ZAm//zBSWqtfUBHqiLsnInfHLC/c3i1uOMBcMUdfAETl 7pmkeGLLpWfXEv13Vs6VnybiwCbfIf9aXdlZONNP/ZagT7SwBS0j9TCHzRUxDaTltV sMtDkyZk0fDOzPSPtnewIXQIhT/kPcb1xOtp6Wd8= Date: Sun, 18 Sep 2022 12:33:06 +0200 From: Greg KH To: Jiho Chu Cc: arnd@arndb.de, ogabbay@kernel.org, krzysztof.kozlowski@linaro.org, broonie@kernel.org, linux-kernel@vger.kernel.org, yelini.jeong@samsung.com, myungjoo.ham@samsung.com Subject: Re: [PATCH v2 07/13] trinity: Add sysfs module Message-ID: References: <20220917072356.2255620-1-jiho.chu@samsung.com> <20220917072356.2255620-8-jiho.chu@samsung.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220917072356.2255620-8-jiho.chu@samsung.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > Signed-off-by: Yelin Jeong > Signed-off-by: Dongju Chae > Signed-off-by: MyungJoo Ham > --- > .../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 > +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