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

From: Sudeep Holla

Date: Fri Oct 16 2026 - 06:13:37 EST


On Wed, Sep 09, 2026 at 10:04:29PM +0000, Philip Radford wrote:
> From: Cristian Marussi <cristian.marussi@xxxxxxx>
>
> Add support for new SCMIv4.0 Powercap Fastchannels.
>
> Signed-off-by: Cristian Marussi <cristian.marussi@xxxxxxx>
> [Philip: removed reference to old versioning logic]
> Signed-off-by: Philip Radford <philip.radford@xxxxxxx>
> ---
> 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