[PATCH v4 11/15] coresight: Control path during CPU idle
James Clark
james.clark at linaro.org
Mon Nov 10 03:44:02 PST 2025
On 04/11/2025 3:21 pm, Leo Yan wrote:
> 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>
Reviewed-by: James Clark <james.clark at linaro.org>
> ---
> 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);
> }
>
>
More information about the linux-arm-kernel
mailing list