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@xxxxxxxxxxx> --- 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