[PATCH v11 5/9] coresight: etm3x: remove redundant cpu online check on etm_enable_sysfs()

From: Yeoreum Yun

Date: Tue Sep 15 2026 - 07:55:15 EST


cpu online() check is done in coresight_validate_source_sysfs() already.
and smp_call_function_single() will fail when cpu is offline.

Therefore, remove redundant check in etm_enable_sysfs().

Signed-off-by: Yeoreum Yun <yeoreum.yun@xxxxxxx>
---
drivers/hwtracing/coresight/coresight-etm3x-core.c | 26 +++++++++-------------
1 file changed, 10 insertions(+), 16 deletions(-)

diff --git a/drivers/hwtracing/coresight/coresight-etm3x-core.c b/drivers/hwtracing/coresight/coresight-etm3x-core.c
index fd76a57e5f861..12bb38dc596e7 100644
--- a/drivers/hwtracing/coresight/coresight-etm3x-core.c
+++ b/drivers/hwtracing/coresight/coresight-etm3x-core.c
@@ -515,25 +515,19 @@ static int etm_enable_sysfs(struct coresight_device *csdev, struct coresight_pat
return -EBUSY;
}

- /*
- * Configure the ETM only if the CPU is online. If it isn't online
- * hw configuration will take place on the local CPU during bring up.
- */
- if (cpu_online(drvdata->cpu)) {
- arg.drvdata = drvdata;
- arg.path = path;
+ arg.drvdata = drvdata;
+ arg.path = path;

- scoped_guard(spinlock, &drvdata->spinlock) {
- arg.config = drvdata->config;
- }
+ scoped_guard(spinlock, &drvdata->spinlock) {
+ arg.config = drvdata->config;
+ }

- ret = smp_call_function_single(drvdata->cpu,
- etm_enable_sysfs_smp_call, &arg, 1);
- if (!ret)
- ret = arg.rc;
- } else {
+ ret = smp_call_function_single(drvdata->cpu,
+ etm_enable_sysfs_smp_call, &arg, 1);
+ if (!ret)
+ ret = arg.rc;
+ else
ret = -ENODEV;
- }

if (!ret) {
dev_dbg(&csdev->dev, "ETM tracing enabled\n");

--
2.43.0