Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] coresight/etm4: fix missing disable active config
@ 2026-11-12 13:54 Shuai Xue
  2026-11-12 14:46 ` Leo Yan
  0 siblings, 1 reply; 2+ messages in thread
From: Shuai Xue @ 2026-11-12 13:54 UTC (permalink / raw)
  To: stable
  Cc: sashal, gregkh, yeoreum.yun, suzuki.poulose, leo.yan, coresight,
	linux-arm-kernel, linux-kernel, xueshuai

From: Yeoreum Yun <yeoreum.yun@arm.com>

commit 895b12b7d7b8c651f73f57a1ea040d35aa7048cb upstream.

When etm4 device is disabled via sysfs, it should disable its active
count.

Fixes: 7ebd0ec6cf94 ("coresight: configfs: Allow configfs to activate configuration")
Signed-off-by: Yeoreum Yun <yeoreum.yun@arm.com>
Reviewed-by: Leo Yan <leo.yan@arm.com>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
[ shuai: kept spin_lock()/spin_unlock() in etm4_disable_sysfs(); 6.6.y does not have the raw spinlock conversion ]
Signed-off-by: Shuai Xue <xueshuai@linux.alibaba.com>
---
Note for stable maintainers: this is patch 1/3 of LKML series
20250514161951.3427590. Its siblings are already in 6.6.y: 2/3
(53b9e2659719) as 1cd09aaf47a5 and 3/3 (408c97c4a5e0) as
b3b4efa2e623, but this one was only ever picked into 6.15.y
(c7f2b00d5e17e) because it does not apply cleanly to 6.6.y without the
raw spinlock conversion. Without it, each sysfs enable/disable cycle
leaks one config_desc->active_cnt reference and the module reference
taken on the config load owner, so the configuration module can never
be unloaded.
 drivers/hwtracing/coresight/coresight-etm4x-core.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/hwtracing/coresight/coresight-etm4x-core.c b/drivers/hwtracing/coresight/coresight-etm4x-core.c
index 593dcfe4c9457..55b20d23b505d 100644
--- a/drivers/hwtracing/coresight/coresight-etm4x-core.c
+++ b/drivers/hwtracing/coresight/coresight-etm4x-core.c
@@ -1078,6 +1078,9 @@ static void etm4_disable_sysfs(struct coresight_device *csdev)
 	smp_call_function_single(drvdata->cpu, etm4_disable_hw, drvdata, 1);
 
 	spin_unlock(&drvdata->spinlock);
+
+	cscfg_csdev_disable_active_config(csdev);
+
 	cpus_read_unlock();
 
 	/*
-- 
2.39.3



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

* Re: [PATCH] coresight/etm4: fix missing disable active config
  2026-11-12 13:54 [PATCH] coresight/etm4: fix missing disable active config Shuai Xue
@ 2026-11-12 14:46 ` Leo Yan
  0 siblings, 0 replies; 2+ messages in thread
From: Leo Yan @ 2026-11-12 14:46 UTC (permalink / raw)
  To: Shuai Xue
  Cc: stable, sashal, gregkh, yeoreum.yun, suzuki.poulose, coresight,
	linux-arm-kernel, linux-kernel

On Thu, Nov 12, 2026 at 09:54:06PM +0800, Shuai Xue wrote:
> From: Yeoreum Yun <yeoreum.yun@arm.com>
> 
> commit 895b12b7d7b8c651f73f57a1ea040d35aa7048cb upstream.
> 
> When etm4 device is disabled via sysfs, it should disable its active
> count.
> 
> Fixes: 7ebd0ec6cf94 ("coresight: configfs: Allow configfs to activate configuration")
> Signed-off-by: Yeoreum Yun <yeoreum.yun@arm.com>
> Reviewed-by: Leo Yan <leo.yan@arm.com>
> Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
> [ shuai: kept spin_lock()/spin_unlock() in etm4_disable_sysfs(); 6.6.y does not have the raw spinlock conversion ]
> Signed-off-by: Shuai Xue <xueshuai@linux.alibaba.com>

> ---
> Note for stable maintainers: this is patch 1/3 of LKML series
> 20250514161951.3427590. Its siblings are already in 6.6.y: 2/3
> (53b9e2659719) as 1cd09aaf47a5 and 3/3 (408c97c4a5e0) as
> b3b4efa2e623, but this one was only ever picked into 6.15.y
> (c7f2b00d5e17e) because it does not apply cleanly to 6.6.y without the
> raw spinlock conversion. Without it, each sysfs enable/disable cycle
> leaks one config_desc->active_cnt reference and the module reference
> taken on the config load owner, so the configuration module can never
> be unloaded.

Makes sense for me. This backport should be applied on both 6.6.y
and 6.12.y.


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

end of thread, other threads:[~2026-11-12 14:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-12 13:54 [PATCH] coresight/etm4: fix missing disable active config Shuai Xue
2026-11-12 14:46 ` Leo Yan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox