[PATCH v1 11/11] coresight: Manage activated paths during CPU hotplug
Leo Yan
leo.yan at arm.com
Fri May 16 09:07:42 PDT 2025
This commit handles activated paths during the CPU hotplug process.
When a CPU is hot-unplugged, and if an activated path is associated with
it, the CPU PM notifier disables the path. This helps saving power,
especially when the CPU is expected to remain offline for long time.
Note, when disabling a path, then sink's disable() callback
automatically updates its buffer SYSFS mode. Therefore, there is no
need to manually update the buffer.
During CPU hotplug-in, the previously active path is re-enabled
accordingly.
Signed-off-by: Leo Yan <leo.yan at arm.com>
---
drivers/hwtracing/coresight/coresight-core.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/hwtracing/coresight/coresight-core.c b/drivers/hwtracing/coresight/coresight-core.c
index a1fb00dbdb55..445908e61d8a 100644
--- a/drivers/hwtracing/coresight/coresight-core.c
+++ b/drivers/hwtracing/coresight/coresight-core.c
@@ -1716,6 +1716,7 @@ static int coresight_starting_cpu(unsigned int cpu)
return 0;
/* Only support SYSFS mode */
+ coresight_enable_path(csdev->path, CS_MODE_SYSFS, NULL);
source_ops(csdev)->enable(csdev, NULL, CS_MODE_SYSFS, csdev->path);
return 0;
}
@@ -1735,6 +1736,13 @@ static int coresight_dying_cpu(unsigned int cpu)
WARN_ON(coresight_get_mode(csdev) != CS_MODE_SYSFS);
coresight_disable_source(csdev, NULL);
+
+ /*
+ * Here, it calls coresight_disable_path_from() instead of invoking
+ * coresight_disable_path() to avoid cleaning up the path pointer
+ * in the coresight_device structure.
+ */
+ coresight_disable_path_from(csdev->path, NULL);
return 0;
}
--
2.34.1
More information about the linux-arm-kernel
mailing list