[PATCH v9 05/13] firmware: arm_scmi: Add SCMIv4.0 Powercap FCs support

Sudeep Holla sudeep.holla at kernel.org
Fri Oct 16 03:13:22 PDT 2026


On Wed, Sep 09, 2026 at 10:04:29PM +0000, Philip Radford wrote:
> From: Cristian Marussi <cristian.marussi at arm.com>
> 
> Add support for new SCMIv4.0 Powercap Fastchannels.
> 
> Signed-off-by: Cristian Marussi <cristian.marussi at arm.com>
> [Philip: removed reference to old versioning logic]
> Signed-off-by: Philip Radford <philip.radford at arm.com>
> ---
>  drivers/firmware/arm_scmi/powercap.c | 331 ++++++++++++++++++---------
>  1 file changed, 229 insertions(+), 102 deletions(-)
> 

[...]

> +static int
> +scmi_powercap_xfer_avg_interval_get_v3(const struct scmi_protocol_handle *ph,
> +				       u32 domain_id, u32 cpl_id, u32 *ivl)
> +{
> +	int ret;
> +	struct scmi_xfer *t;
> +	struct scmi_msg_powercap_cap_or_cai_get_v3 *msg;
> +
> +	ret = ph->xops->xfer_get_init(ph, POWERCAP_CAI_GET, sizeof(*msg),
> +				      sizeof(u32), &t);
> +	if (ret)
> +		return ret;
> +
> +	msg = t->tx.buf;
> +	msg->domain_id = cpu_to_le32(domain_id);
> +	msg->cpli = cpu_to_le32(cpl_id);

Is this inconsistent with scmi_powercap_xfer_cap_{g,s}et_v3() which IMO
correctly uses pc->cpli[cpl_id].id instead of cpl_id or am I just confusing
the flow ? The spec is clear that it must be concurrent power limit identifier.


[...]

> +static int
> +scmi_powercap_xfer_avg_interval_set_v3(const struct scmi_protocol_handle *ph,
> +				       u32 domain_id, u32 cpl_id, u32 ivl)
>  {
>  	int ret;
>  	struct scmi_xfer *t;
> -	struct scmi_msg_powercap_set_cap_or_pai *msg;
> +	struct scmi_msg_powercap_cai_set *msg;
>  
> -	ret = ph->xops->xfer_get_init(ph, POWERCAP_PAI_SET,
> -				      sizeof(*msg), 0, &t);
> +	ret = ph->xops->xfer_get_init(ph, POWERCAP_CAI_SET, sizeof(*msg), 0, &t);
>  	if (ret)
>  		return ret;
>  
>  	msg = t->tx.buf;
>  	msg->domain_id = cpu_to_le32(domain_id);
>  	msg->flags = cpu_to_le32(0);
> -	msg->value = cpu_to_le32(pai);
> +	msg->cai = cpu_to_le32(ivl);
> +	msg->cpli = cpu_to_le32(cpl_id);

Ditto here.

-- 
Regards,
Sudeep



More information about the linux-arm-kernel mailing list