mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Lukasz Luba <lukasz.luba@arm.com>
To: Ye Zhang <ye.zhang@rock-chips.com>
Cc: tao.huang@rock-chips.com, heiko@sntech.de, rui.zhang@intel.com,
	finley.xiao@rock-chips.com, linux-rockchip@lists.infradead.org,
	linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
	daniel.lezcano@linaro.org, rafael@kernel.org
Subject: Re: [PATCH v1] thermal: devfreq_cooling: Fix perf state when calculate dfc res_util
Date: Wed, 20 Mar 2024 14:15:54 +0000	[thread overview]
Message-ID: <fb9b21f6-4c73-4a85-93cc-56e7c44359cb@arm.com> (raw)
In-Reply-To: <20240320075704.1924897-1-ye.zhang@rock-chips.com>

Hi Ye,

On 3/20/24 07:57, Ye Zhang wrote:
> The EM power table is sorted ascending,can't index the table by cooling
> device state,so convert cooling state to performance state by
> dfc->max_state - dfc->capped_state.
> 
> Signed-off-by: Ye Zhang <ye.zhang@rock-chips.com>
> ---
>   drivers/thermal/devfreq_cooling.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/thermal/devfreq_cooling.c b/drivers/thermal/devfreq_cooling.c
> index 50dec24e967a..8fd7cf1932cd 100644
> --- a/drivers/thermal/devfreq_cooling.c
> +++ b/drivers/thermal/devfreq_cooling.c
> @@ -214,7 +214,7 @@ static int devfreq_cooling_get_requested_power(struct thermal_cooling_device *cd
>   
>   		res = dfc->power_ops->get_real_power(df, power, freq, voltage);
>   		if (!res) {
> -			state = dfc->capped_state;
> +			state = dfc->max_state - dfc->capped_state;
>   
>   			/* Convert EM power into milli-Watts first */
>   			rcu_read_lock();

Thank you for the patch. Good catch! It's under the device driver
callback optional thing: get_real_power().

Please send the v2 with extended explanation about the section
of the code, which is triggered by the get_real_power() presence.
Also, please add the tags, so it can be collected by stable kernel.

Fixes: 615510fe13bd2434610 ("thermal: devfreq_cooling: remove old power 
model and use EM")
Cc: 5.11+ <stable@vger.kernel.org> # 5.11+

BTW, how did you trigger that issue? Do you have such a driver
which provides this get_real_power() callback?

Regards,
Lukasz

       reply	other threads:[~2024-03-20 14:15 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20240320075704.1924897-1-ye.zhang@rock-chips.com>
2024-03-20 14:15 ` Lukasz Luba [this message]
     [not found]   ` <ANIAEAAdHuSn9iPJ6HkLiaq2.3.1711010230402.Hmail.ye.zhang@rock-chips.com>
2024-03-21  8:44     ` Lukasz Luba

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=fb9b21f6-4c73-4a85-93cc-56e7c44359cb@arm.com \
    --to=lukasz.luba@arm.com \
    --cc=daniel.lezcano@linaro.org \
    --cc=finley.xiao@rock-chips.com \
    --cc=heiko@sntech.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=rafael@kernel.org \
    --cc=rui.zhang@intel.com \
    --cc=tao.huang@rock-chips.com \
    --cc=ye.zhang@rock-chips.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

all inboxes | Powered by JetHome®