linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Cristian Marussi <cristian.marussi@arm.com>
To: Sudeep Holla <sudeep.holla@arm.com>
Cc: linux-arm-kernel@lists.infradead.org, xinglong.yang@cixtech.com
Subject: Re: [PATCH] firmware: arm_scmi: Populate fastchannel info only if set operations are allowed
Date: Wed, 15 Nov 2023 15:26:51 +0000	[thread overview]
Message-ID: <ZVTjO7h3tYkvwgAS@pluto> (raw)
In-Reply-To: <20231113143252.37160-1-sudeep.holla@arm.com>

On Mon, Nov 13, 2023 at 02:32:52PM +0000, Sudeep Holla wrote:
> Certain SCMI performance domains may have restrictions on the set level
> and/or limits operation. If the SCMI domain supports fastchannel and the
> set operations are not allowed, then any attempts to fetch the fastchannel
> information for set level and/or limits operation will result in the
> SCMI platform returning SCMI_ERR_SUPPORT. However, since this information
> about the domain is already known to the agent(OSPM here) obtained via
> PERF_DOMAIN_ATTRIBUTES, the agent(OSPM) can avoid calls to the firmware
> trying to fetch the fastchannel information for the same.
> 
> Add those checks and skip querying the fastchannel information from the
> firmware based on the information collected during the domain enumeration
> stage.
> 

LGTM.

Reviewed-by: Cristian Marussi <cristian.marussi@arm.com>

Thanks,
Cristian

> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
> ---
>  drivers/firmware/arm_scmi/perf.c | 27 +++++++++++++++++----------
>  1 file changed, 17 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/firmware/arm_scmi/perf.c b/drivers/firmware/arm_scmi/perf.c
> index f5a063b0b1ab..36cdcfaf4324 100644
> --- a/drivers/firmware/arm_scmi/perf.c
> +++ b/drivers/firmware/arm_scmi/perf.c
> @@ -762,29 +762,36 @@ static void scmi_perf_domain_init_fc(const struct scmi_protocol_handle *ph,
>  				     u32 domain, struct scmi_fc_info **p_fc)
>  {
>  	struct scmi_fc_info *fc;
> +	struct perf_dom_info *dom;
> +
> +	dom = scmi_perf_domain_lookup(ph, domain);
> +	if (IS_ERR(dom))
> +		return;
>  
>  	fc = devm_kcalloc(ph->dev, PERF_FC_MAX, sizeof(*fc), GFP_KERNEL);
>  	if (!fc)
>  		return;
>  
> -	ph->hops->fastchannel_init(ph, PERF_DESCRIBE_FASTCHANNEL,
> -				   PERF_LEVEL_SET, 4, domain,
> -				   &fc[PERF_FC_LEVEL].set_addr,
> -				   &fc[PERF_FC_LEVEL].set_db);
> -
>  	ph->hops->fastchannel_init(ph, PERF_DESCRIBE_FASTCHANNEL,
>  				   PERF_LEVEL_GET, 4, domain,
>  				   &fc[PERF_FC_LEVEL].get_addr, NULL);
>  
> -	ph->hops->fastchannel_init(ph, PERF_DESCRIBE_FASTCHANNEL,
> -				   PERF_LIMITS_SET, 8, domain,
> -				   &fc[PERF_FC_LIMIT].set_addr,
> -				   &fc[PERF_FC_LIMIT].set_db);
> -
>  	ph->hops->fastchannel_init(ph, PERF_DESCRIBE_FASTCHANNEL,
>  				   PERF_LIMITS_GET, 8, domain,
>  				   &fc[PERF_FC_LIMIT].get_addr, NULL);
>  
> +	if (dom->info.set_perf)
> +		ph->hops->fastchannel_init(ph, PERF_DESCRIBE_FASTCHANNEL,
> +					   PERF_LEVEL_SET, 4, domain,
> +					   &fc[PERF_FC_LEVEL].set_addr,
> +					   &fc[PERF_FC_LEVEL].set_db);
> +
> +	if (dom->set_limits)
> +		ph->hops->fastchannel_init(ph, PERF_DESCRIBE_FASTCHANNEL,
> +					   PERF_LIMITS_SET, 8, domain,
> +					   &fc[PERF_FC_LIMIT].set_addr,
> +					   &fc[PERF_FC_LIMIT].set_db);
> +
>  	*p_fc = fc;
>  }
>  
> -- 
> 2.42.0
> 

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2023-11-15 15:27 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-13 14:32 [PATCH] firmware: arm_scmi: Populate fastchannel info only if set operations are allowed Sudeep Holla
2023-11-15 15:26 ` Cristian Marussi [this message]
2023-11-16 18:25 ` Sudeep Holla

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=ZVTjO7h3tYkvwgAS@pluto \
    --to=cristian.marussi@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=sudeep.holla@arm.com \
    --cc=xinglong.yang@cixtech.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).