public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Yao Zi <ziyao@disroot.org>
To: Jonathan Corbet <corbet@lwn.net>,
	Michael Turquette <mturquette@baylibre.com>,
	Stephen Boyd <sboyd@kernel.org>
Cc: Yao Zi <ziyao@disroot.org>,
	linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] docs: clk: describe userspace debugging facilities
Date: Mon, 18 Nov 2024 19:25:27 +0000	[thread overview]
Message-ID: <20241118192526.44180-2-ziyao@disroot.org> (raw)

Starting from commit
03111b1088f1 ("clk: Add support for enabling/disabling clocks from debugfs"),
it's possible to operate clocks from userspace through debugfs for
testing purpose. This feature isn't provided as a Kconfig but rather a
macro in source for security consideration, thus is hard to find.

Let's document the macro to ease everyone's life of clock debugging.

Signed-off-by: Yao Zi <ziyao@disroot.org>
---
 Documentation/driver-api/clk.rst | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/Documentation/driver-api/clk.rst b/Documentation/driver-api/clk.rst
index 93bab5336dfd..1787c07e8e19 100644
--- a/Documentation/driver-api/clk.rst
+++ b/Documentation/driver-api/clk.rst
@@ -310,3 +310,11 @@ driver in that case.
 Note that locking must also be considered when code outside of the common
 clock framework needs to access resources used by the clock operations. This
 is considered out of scope of this document.
+
+Debug in Userspace
+==================
+
+The common clk framework creates read-only debugfs entries at
+``/sys/kernel/debug/clk``. For test and debug purpose, you could define
+``CLOCK_ALLOW_WRITE_DEBUGFS`` in ``drivers/clk/clk.c`` to make them writable.
+This may cause security problems and should *NEVER* be enabled on production.
-- 
2.47.0


             reply	other threads:[~2024-11-18 19:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-18 19:25 Yao Zi [this message]
2024-12-03 22:11 ` [PATCH] docs: clk: describe userspace debugging facilities Stephen Boyd

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241118192526.44180-2-ziyao@disroot.org \
    --to=ziyao@disroot.org \
    --cc=corbet@lwn.net \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mturquette@baylibre.com \
    --cc=sboyd@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox