All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dhruva Gole <d-gole@ti.com>
To: Sibi Sankar <quic_sibis@quicinc.com>
Cc: <sudeep.holla@arm.com>, <cristian.marussi@arm.com>,
	<rafael@kernel.org>, <viresh.kumar@linaro.org>,
	<morten.rasmussen@arm.com>, <dietmar.eggemann@arm.com>,
	<lukasz.luba@arm.com>, <sboyd@kernel.org>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-pm@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<quic_mdtipton@quicinc.com>, <linux-arm-msm@vger.kernel.org>,
	<nm@ti.com>
Subject: Re: [PATCH V3 1/2] firmware: arm_scmi: Add support for marking certain frequencies as boost
Date: Mon, 11 Mar 2024 11:05:54 +0530	[thread overview]
Message-ID: <20240311053554.36j2rq3wgtswwoom@dhruva> (raw)
In-Reply-To: <20240308104410.385631-2-quic_sibis@quicinc.com>

On Mar 08, 2024 at 16:14:09 +0530, Sibi Sankar wrote:
> All opps above the sustained level/frequency are treated as boost, so mark

I know that we use the terms boost and turbo interchangeably however I
would suggest to avoid confusion that we say "treated as turbo" just
because the variable is called turbo.

> them accordingly.
> 
> Suggested-by: Sudeep Holla <sudeep.holla@arm.com>
> Signed-off-by: Sibi Sankar <quic_sibis@quicinc.com>
> ---
>  drivers/firmware/arm_scmi/perf.c | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/firmware/arm_scmi/perf.c b/drivers/firmware/arm_scmi/perf.c
> index 8e832d1ad825..64d9a90bf443 100644
> --- a/drivers/firmware/arm_scmi/perf.c
> +++ b/drivers/firmware/arm_scmi/perf.c
> @@ -857,7 +857,7 @@ static int scmi_dvfs_device_opps_add(const struct scmi_protocol_handle *ph,
>  				     struct device *dev, u32 domain)
>  {
>  	int idx, ret;
> -	unsigned long freq;
> +	unsigned long freq, sustained_freq;
>  	struct dev_pm_opp_data data = {};
>  	struct perf_dom_info *dom;
>  
> @@ -865,12 +865,18 @@ static int scmi_dvfs_device_opps_add(const struct scmi_protocol_handle *ph,
>  	if (IS_ERR(dom))
>  		return PTR_ERR(dom);
>  
> +	sustained_freq = dom->sustained_freq_khz * 1000UL;
> +
>  	for (idx = 0; idx < dom->opp_count; idx++) {
>  		if (!dom->level_indexing_mode)
>  			freq = dom->opp[idx].perf * dom->mult_factor;
>  		else
>  			freq = dom->opp[idx].indicative_freq * dom->mult_factor;
>  
> +		/* All opps above the sustained level/frequency are treated as boost */

Same here, would be better to say "turbo" than boost.

> +		if (freq > sustained_freq)
> +			data.turbo = true;

It's simple enough that we can write it as
data.turbo = (freq > sustained_freq_khz*1000) ? true : false;

We can avoid an additional variable and all the other code changes.


-- 
Best regards,
Dhruva Gole <d-gole@ti.com>

WARNING: multiple messages have this Message-ID (diff)
From: Dhruva Gole <d-gole@ti.com>
To: Sibi Sankar <quic_sibis@quicinc.com>
Cc: <sudeep.holla@arm.com>, <cristian.marussi@arm.com>,
	<rafael@kernel.org>, <viresh.kumar@linaro.org>,
	<morten.rasmussen@arm.com>, <dietmar.eggemann@arm.com>,
	<lukasz.luba@arm.com>, <sboyd@kernel.org>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-pm@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<quic_mdtipton@quicinc.com>, <linux-arm-msm@vger.kernel.org>,
	<nm@ti.com>
Subject: Re: [PATCH V3 1/2] firmware: arm_scmi: Add support for marking certain frequencies as boost
Date: Mon, 11 Mar 2024 11:05:54 +0530	[thread overview]
Message-ID: <20240311053554.36j2rq3wgtswwoom@dhruva> (raw)
In-Reply-To: <20240308104410.385631-2-quic_sibis@quicinc.com>

On Mar 08, 2024 at 16:14:09 +0530, Sibi Sankar wrote:
> All opps above the sustained level/frequency are treated as boost, so mark

I know that we use the terms boost and turbo interchangeably however I
would suggest to avoid confusion that we say "treated as turbo" just
because the variable is called turbo.

> them accordingly.
> 
> Suggested-by: Sudeep Holla <sudeep.holla@arm.com>
> Signed-off-by: Sibi Sankar <quic_sibis@quicinc.com>
> ---
>  drivers/firmware/arm_scmi/perf.c | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/firmware/arm_scmi/perf.c b/drivers/firmware/arm_scmi/perf.c
> index 8e832d1ad825..64d9a90bf443 100644
> --- a/drivers/firmware/arm_scmi/perf.c
> +++ b/drivers/firmware/arm_scmi/perf.c
> @@ -857,7 +857,7 @@ static int scmi_dvfs_device_opps_add(const struct scmi_protocol_handle *ph,
>  				     struct device *dev, u32 domain)
>  {
>  	int idx, ret;
> -	unsigned long freq;
> +	unsigned long freq, sustained_freq;
>  	struct dev_pm_opp_data data = {};
>  	struct perf_dom_info *dom;
>  
> @@ -865,12 +865,18 @@ static int scmi_dvfs_device_opps_add(const struct scmi_protocol_handle *ph,
>  	if (IS_ERR(dom))
>  		return PTR_ERR(dom);
>  
> +	sustained_freq = dom->sustained_freq_khz * 1000UL;
> +
>  	for (idx = 0; idx < dom->opp_count; idx++) {
>  		if (!dom->level_indexing_mode)
>  			freq = dom->opp[idx].perf * dom->mult_factor;
>  		else
>  			freq = dom->opp[idx].indicative_freq * dom->mult_factor;
>  
> +		/* All opps above the sustained level/frequency are treated as boost */

Same here, would be better to say "turbo" than boost.

> +		if (freq > sustained_freq)
> +			data.turbo = true;

It's simple enough that we can write it as
data.turbo = (freq > sustained_freq_khz*1000) ? true : false;

We can avoid an additional variable and all the other code changes.


-- 
Best regards,
Dhruva Gole <d-gole@ti.com>

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

  parent reply	other threads:[~2024-03-11  5:36 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-08 10:44 [PATCH V3 0/2] cpufreq: scmi: Add boost frequency support Sibi Sankar
2024-03-08 10:44 ` Sibi Sankar
2024-03-08 10:44 ` [PATCH V3 1/2] firmware: arm_scmi: Add support for marking certain frequencies as boost Sibi Sankar
2024-03-08 10:44   ` Sibi Sankar
2024-03-08 13:59   ` Sudeep Holla
2024-03-08 13:59     ` Sudeep Holla
2024-03-11  5:35   ` Dhruva Gole [this message]
2024-03-11  5:35     ` Dhruva Gole
2024-03-11  5:49     ` Viresh Kumar
2024-03-11  5:49       ` Viresh Kumar
2024-03-08 10:44 ` [PATCH V3 2/2] cpufreq: scmi: Enable boost support Sibi Sankar
2024-03-08 10:44   ` Sibi Sankar
2024-03-08 14:06   ` Sudeep Holla
2024-03-08 14:06     ` Sudeep Holla
2024-03-11  4:55     ` Viresh Kumar
2024-03-11  4:55       ` Viresh Kumar
2024-03-11  9:04       ` Sudeep Holla
2024-03-11  9:04         ` 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=20240311053554.36j2rq3wgtswwoom@dhruva \
    --to=d-gole@ti.com \
    --cc=cristian.marussi@arm.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=lukasz.luba@arm.com \
    --cc=morten.rasmussen@arm.com \
    --cc=nm@ti.com \
    --cc=quic_mdtipton@quicinc.com \
    --cc=quic_sibis@quicinc.com \
    --cc=rafael@kernel.org \
    --cc=sboyd@kernel.org \
    --cc=sudeep.holla@arm.com \
    --cc=viresh.kumar@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.