linux-doc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] docs: clk: describe userspace debugging facilities
@ 2024-11-18 19:25 Yao Zi
  2024-12-03 22:11 ` Stephen Boyd
  0 siblings, 1 reply; 2+ messages in thread
From: Yao Zi @ 2024-11-18 19:25 UTC (permalink / raw)
  To: Jonathan Corbet, Michael Turquette, Stephen Boyd
  Cc: Yao Zi, linux-doc, linux-kernel

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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] docs: clk: describe userspace debugging facilities
  2024-11-18 19:25 [PATCH] docs: clk: describe userspace debugging facilities Yao Zi
@ 2024-12-03 22:11 ` Stephen Boyd
  0 siblings, 0 replies; 2+ messages in thread
From: Stephen Boyd @ 2024-12-03 22:11 UTC (permalink / raw)
  To: Jonathan Corbet, Michael Turquette, Yao Zi
  Cc: Yao Zi, linux-doc, linux-kernel

Quoting Yao Zi (2024-11-18 11:25:27)
> 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.

Thanks for the patch. I don't want to advertise this anymore than it
already is though so let's skip this patch.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-12-03 22:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-18 19:25 [PATCH] docs: clk: describe userspace debugging facilities Yao Zi
2024-12-03 22:11 ` Stephen Boyd

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).