[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241118192526.44180-2-ziyao@disroot.org>
Date: Mon, 18 Nov 2024 19:25:27 +0000
From: Yao Zi <ziyao@...root.org>
To: Jonathan Corbet <corbet@....net>,
Michael Turquette <mturquette@...libre.com>,
Stephen Boyd <sboyd@...nel.org>
Cc: Yao Zi <ziyao@...root.org>,
linux-doc@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: [PATCH] docs: clk: describe userspace debugging facilities
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@...root.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
Powered by blists - more mailing lists