Linux Power Management development
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@linaro.org>
To: Cristian Marussi <cristian.marussi@arm.com>
Cc: linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, arm-scmi@vger.kernel.org,
	linux-pm@vger.kernel.org, sudeep.holla@arm.com,
	james.quinlan@broadcom.com, f.fainelli@gmail.com,
	vincent.guittot@linaro.org, etienne.carriere@st.com,
	peng.fan@oss.nxp.com, michal.simek@amd.com,
	quic_sibis@quicinc.com, d-gole@ti.com,
	souvik.chakravarty@arm.com
Subject: Re: [PATCH 3/8] firmware: arm_scmi: Refactor powercap domain layout
Date: Fri, 15 Aug 2025 16:13:57 +0300	[thread overview]
Message-ID: <aJ8ylY6jjS70z8lL@stanley.mountain> (raw)
In-Reply-To: <20250813114609.1305571-4-cristian.marussi@arm.com>

On Wed, Aug 13, 2025 at 12:46:04PM +0100, Cristian Marussi wrote:
> @@ -486,7 +514,7 @@ static int scmi_powercap_xfer_pai_get(const struct scmi_protocol_handle *ph,
>  }
>  
>  static int scmi_powercap_pai_get(const struct scmi_protocol_handle *ph,
> -				 u32 domain_id, u32 *pai)
> +				 u32 domain_id, u32 cpl_id, u32 *pai)
>  {
>  	struct scmi_powercap_info *dom;
>  	struct powercap_info *pi = ph->get_priv(ph);
> @@ -495,8 +523,11 @@ static int scmi_powercap_pai_get(const struct scmi_protocol_handle *ph,
>  		return -EINVAL;
>  
>  	dom = pi->powercaps + domain_id;
> -	if (dom->fc_info && dom->fc_info[POWERCAP_FC_PAI].get_addr) {
> -		*pai = ioread32(dom->fc_info[POWERCAP_FC_PAI].get_addr);
> +	if (cpl_id > dom->num_cpli)

This gets fixed later in the series but it should be >=.

regards,
dan carpenter

> +		return -EINVAL;
> +
> +	if (dom->cpli[cpl_id].fc_info && dom->cpli[cpl_id].fc_info[POWERCAP_FC_PAI].get_addr) {
> +		*pai = ioread32(dom->cpli[cpl_id].fc_info[POWERCAP_FC_PAI].get_addr);
>  		trace_scmi_fc_call(SCMI_PROTOCOL_POWERCAP, POWERCAP_PAI_GET,
>  				   domain_id, *pai, 0);
>  		return 0;


  reply	other threads:[~2025-08-15 13:14 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-13 11:46 [PATCH 0/8] Add support for SCMIv4.0 Powercap Extensions Cristian Marussi
2025-08-13 11:46 ` [PATCH 1/8] firmware: arm_scmi: Add an optional custom parameter to fastchannel helpers Cristian Marussi
2025-08-13 11:46 ` [PATCH 2/8] firmware: arm_scmi: Add bound iterators support Cristian Marussi
2025-08-13 11:46 ` [PATCH 3/8] firmware: arm_scmi: Refactor powercap domain layout Cristian Marussi
2025-08-15 13:13   ` Dan Carpenter [this message]
2025-08-13 11:46 ` [PATCH 4/8] firmware: arm_scmi: Add SCMIv4.0 Powercap basic support Cristian Marussi
2025-08-14 13:54   ` kernel test robot
2025-08-13 11:46 ` [PATCH 5/8] firmware: arm_scmi: Add SCMIv4.0 Powercap FCs support Cristian Marussi
2025-08-13 11:46 ` [PATCH 6/8] firmware: arm_scmi: Add SCMIV4.0 Powercap notifications support Cristian Marussi
2025-08-13 11:46 ` [PATCH 7/8] include: trace: Add new parameter to trace_scmi_fc_call Cristian Marussi
2025-08-13 11:46 ` [PATCH 8/8] powercap: arm_scmi: Enable multiple constraints support Cristian Marussi

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=aJ8ylY6jjS70z8lL@stanley.mountain \
    --to=dan.carpenter@linaro.org \
    --cc=arm-scmi@vger.kernel.org \
    --cc=cristian.marussi@arm.com \
    --cc=d-gole@ti.com \
    --cc=etienne.carriere@st.com \
    --cc=f.fainelli@gmail.com \
    --cc=james.quinlan@broadcom.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=michal.simek@amd.com \
    --cc=peng.fan@oss.nxp.com \
    --cc=quic_sibis@quicinc.com \
    --cc=souvik.chakravarty@arm.com \
    --cc=sudeep.holla@arm.com \
    --cc=vincent.guittot@linaro.org \
    /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