[PATCH v4 11/15] coresight: Control path during CPU idle
Leo Yan
leo.yan at arm.com
Tue Nov 4 07:21:55 PST 2025
Control links and helpers on an activated path during CPU idle. Since
coresight_disable_path_from() does not handle a source device's
helpers, explicitly disable them alongside the source device.
Signed-off-by: Leo Yan <leo.yan at arm.com>
---
drivers/hwtracing/coresight/coresight-core.c | 22 +++++++++++++++++++++-
1 file changed, 21 insertions(+), 1 deletion(-)
diff --git a/drivers/hwtracing/coresight/coresight-core.c b/drivers/hwtracing/coresight/coresight-core.c
index 6c12692efb51c63f3aa9da6f65a349eae1926f4d..73be22c8f315525111f2dafd692e61bc6db85c25 100644
--- a/drivers/hwtracing/coresight/coresight-core.c
+++ b/drivers/hwtracing/coresight/coresight-core.c
@@ -1661,11 +1661,31 @@ static bool coresight_pm_is_needed(struct coresight_device *csdev)
static int coresight_pm_save(struct coresight_device *csdev)
{
- return coresight_ops(csdev)->pm_save_disable(csdev);
+ int ret;
+
+ if (WARN_ON(!csdev->path))
+ return -EINVAL;
+
+ ret = coresight_ops(csdev)->pm_save_disable(csdev);
+ if (ret)
+ return ret;
+
+ coresight_disable_helpers(csdev, NULL);
+ coresight_disable_path_from(csdev->path, NULL, true);
+ return 0;
}
static void coresight_pm_restore(struct coresight_device *csdev)
{
+ if (WARN_ON(!csdev->path))
+ return;
+
+ /*
+ * During CPU idle, the sink device is not accessed, so it is okay to
+ * pass a NULL pointer for the 'sink_data' parameter.
+ */
+ coresight_enable_path_internal(csdev->path, coresight_get_mode(csdev),
+ NULL, true);
coresight_ops(csdev)->pm_restore_enable(csdev);
}
--
2.34.1
More information about the linux-arm-kernel
mailing list