[PATCH RFC 02/10] coresight: cpu-debug: Make the enable parameter read-only in sysfs

Igor Velkov via B4 Relay devnull+iav.iav.lv at kernel.org
Thu Nov 26 22:38:39 PST 2026


From: Igor Velkov <iav at iav.lv>

A write to /sys/module/coresight_cpu_debug/parameters/enable changes
debug_enable but takes no runtime PM reference, so the driver then
reads the debug registers with their clock and power domain possibly
off. A later write to the debugfs knob finds debug_enable already set
and does nothing.

Leave the parameter for the command line and for module load, and the
debugfs knob for run time, as the documentation describes. A set
callback that does what the knob does would also work, but one run-time
interface is enough.

Fixes: 2227b7c74634 ("coresight: add support for CPU debug module")
Signed-off-by: Igor Velkov <iav at iav.lv>
---
 drivers/hwtracing/coresight/coresight-cpu-debug.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/hwtracing/coresight/coresight-cpu-debug.c b/drivers/hwtracing/coresight/coresight-cpu-debug.c
index edccbd2fa5e2..f9e6e344ed59 100644
--- a/drivers/hwtracing/coresight/coresight-cpu-debug.c
+++ b/drivers/hwtracing/coresight/coresight-cpu-debug.c
@@ -109,7 +109,7 @@ static int debug_count;
 static struct dentry *debug_debugfs_dir;
 
 static bool debug_enable = IS_ENABLED(CONFIG_CORESIGHT_CPU_DEBUG_DEFAULT_ON);
-module_param_named(enable, debug_enable, bool, 0600);
+module_param_named(enable, debug_enable, bool, 0400);
 MODULE_PARM_DESC(enable, "Control to enable coresight CPU debug functionality");
 
 static void debug_os_unlock(struct debug_drvdata *drvdata)

-- 
2.43.0





More information about the linux-arm-kernel mailing list