linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: James Clark <james.clark@linaro.org>
To: Leo Yan <leo.yan@arm.com>
Cc: Suzuki K Poulose <suzuki.poulose@arm.com>,
	Mike Leach <mike.leach@linaro.org>, Yabin Cui <yabinc@google.com>,
	coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v1 05/11] coresight: Save activated path into source device
Date: Tue, 3 Jun 2025 15:49:26 +0100	[thread overview]
Message-ID: <788e698d-aa1a-47ba-829f-aef9cd4b7417@linaro.org> (raw)
In-Reply-To: <20250516160742.1200904-6-leo.yan@arm.com>



On 16/05/2025 5:07 pm, Leo Yan wrote:
> For a source device, save activated path into the coresight_device
> structure.
> 
> This will be used by sequential changes for controlling the path during
> CPU idle.
> 
> Signed-off-by: Leo Yan <leo.yan@arm.com>
> ---
>   drivers/hwtracing/coresight/coresight-core.c | 10 ++++++++++
>   include/linux/coresight.h                    |  3 +++
>   2 files changed, 13 insertions(+)
> 
> diff --git a/drivers/hwtracing/coresight/coresight-core.c b/drivers/hwtracing/coresight/coresight-core.c
> index 7ab7321ca8d5..8f565bb3c535 100644
> --- a/drivers/hwtracing/coresight/coresight-core.c
> +++ b/drivers/hwtracing/coresight/coresight-core.c
> @@ -495,6 +495,12 @@ static void coresight_disable_path_from(struct coresight_path *path,
>   
>   void coresight_disable_path(struct coresight_path *path)
>   {
> +	struct coresight_device *source;
> +
> +	source = coresight_get_source(path);
> +	if (coresight_is_percpu_source(source))
> +		source->path = NULL;
> +
>   	coresight_disable_path_from(path, NULL);
>   }
>   EXPORT_SYMBOL_GPL(coresight_disable_path);
> @@ -577,6 +583,10 @@ int coresight_enable_path(struct coresight_path *path, enum cs_mode mode,
>   		}
>   	}
>   
> +	source = coresight_get_source(path);
> +	if (coresight_is_percpu_source(source))
> +		source->path = path;
> +
>   out:
>   	return ret;
>   err_disable_helpers:
> diff --git a/include/linux/coresight.h b/include/linux/coresight.h
> index 64cee4040daa..cd9709a36b9c 100644
> --- a/include/linux/coresight.h
> +++ b/include/linux/coresight.h
> @@ -265,6 +265,7 @@ struct coresight_trace_id_map {
>    *		CS_MODE_SYSFS. Otherwise it must be accessed from inside the
>    *		spinlock.
>    * @orphan:	true if the component has connections that haven't been linked.
> + * @path:	activated path pointer (only used for source device).
>    * @sysfs_sink_activated: 'true' when a sink has been selected for use via sysfs
>    *		by writing a 1 to the 'enable_sink' file.  A sink can be
>    *		activated but not yet enabled.  Enabling for a _sink_ happens
> @@ -291,6 +292,8 @@ struct coresight_device {
>   	local_t	mode;
>   	int refcnt;
>   	bool orphan;
> +	/* activated path (for source only) */
> +	struct coresight_path *path;

This is probably cleaner if it's saved in the new global per-cpu you 
added in patch 2. It's even more specific than "for source only", it's 
actually only for per-cpu sources so it's not worth having it on every 
device.

>   	/* sink specific fields */
>   	bool sysfs_sink_activated;
>   	struct dev_ext_attribute *ea;



  reply	other threads:[~2025-06-03 14:53 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-16 16:07 [PATCH v1 00/11] CoreSight: Refactor CPU PM and hotplug Leo Yan
2025-05-16 16:07 ` [PATCH v1 01/11] coresight: etm4x: Control the trace unit in CPU suspend Leo Yan
2025-06-03 13:40   ` James Clark
2025-06-04  9:48     ` Suzuki K Poulose
2025-06-04 10:50       ` James Clark
2025-06-18 14:34         ` Leo Yan
2025-05-16 16:07 ` [PATCH v1 02/11] coresight: Set per CPU source pointer Leo Yan
2025-06-03 14:12   ` James Clark
2025-06-04 10:03     ` Suzuki K Poulose
2025-05-16 16:07 ` [PATCH v1 03/11] coresight: Register CPU PM notifier in core layer Leo Yan
2025-05-16 16:07 ` [PATCH v1 04/11] coresight: etm4x: Hook CPU PM callbacks Leo Yan
2025-05-16 16:07 ` [PATCH v1 05/11] coresight: Save activated path into source device Leo Yan
2025-06-03 14:49   ` James Clark [this message]
2025-06-20 14:24     ` Leo Yan
2025-06-24 12:52       ` James Clark
2025-05-16 16:07 ` [PATCH v1 06/11] coresight: Control path during CPU PM Leo Yan
2025-06-03 14:49   ` James Clark
2025-05-16 16:07 ` [PATCH v1 07/11] coresight: Add PM callbacks in sink operation Leo Yan
2025-05-16 16:07 ` [PATCH v1 08/11] coresight: trbe: Save and restore state across CPU low power state Leo Yan
2025-05-16 16:07 ` [PATCH v1 09/11] coresight: Take hotplug lock in enable_source_store() for Sysfs mode Leo Yan
2025-06-03 15:31   ` James Clark
2025-05-16 16:07 ` [PATCH v1 10/11] coresight: Move CPU hotplug callbacks to core layer Leo Yan
2025-05-16 16:07 ` [PATCH v1 11/11] coresight: Manage activated paths during CPU hotplug Leo Yan
2025-05-16 22:40 ` [PATCH v1 00/11] CoreSight: Refactor CPU PM and hotplug Yabin Cui
2025-06-05 13:50 ` James Clark
2025-06-05 16:39   ` Leo Yan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=788e698d-aa1a-47ba-829f-aef9cd4b7417@linaro.org \
    --to=james.clark@linaro.org \
    --cc=coresight@lists.linaro.org \
    --cc=leo.yan@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=mike.leach@linaro.org \
    --cc=suzuki.poulose@arm.com \
    --cc=yabinc@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).