Linux Power Management development
 help / color / mirror / Atom feed
From: Viresh Kumar <viresh.kumar@linaro.org>
To: Hoan Tran <hotran@apm.com>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>,
	pprakash@codeaurora.org, Al Stone <ahs3@redhat.com>,
	linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
	lho@apm.com, Duc Dang <dhdang@apm.com>
Subject: Re: [PATCH] cpufreq: CPPC: Correct desired_perf calculation
Date: Wed, 12 Oct 2016 08:51:53 +0530	[thread overview]
Message-ID: <20161012032153.GE19385@vireshk-i7> (raw)
In-Reply-To: <1476220320-19685-1-git-send-email-hotran@apm.com>

On 11-10-16, 14:12, Hoan Tran wrote:
> The desired_perf is an abstract performance number. Its value should
> be in the range of [lowest perf, highest perf] of CPPC.
> The correct calculation is
>   desired_perf = freq * cppc_highest_perf / cppc_dmi_max_khz
> 
> Signed-off-by: Hoan Tran <hotran@apm.com>
> ---
>  drivers/cpufreq/cppc_cpufreq.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/cpufreq/cppc_cpufreq.c b/drivers/cpufreq/cppc_cpufreq.c
> index 1b2f28f..ab1d4b7 100644
> --- a/drivers/cpufreq/cppc_cpufreq.c
> +++ b/drivers/cpufreq/cppc_cpufreq.c
> @@ -84,7 +84,7 @@ static int cppc_cpufreq_set_target(struct cpufreq_policy *policy,
>  
>  	cpu = all_cpu_data[policy->cpu];
>  
> -	cpu->perf_ctrls.desired_perf = (u64)target_freq * policy->max / cppc_dmi_max_khz;
> +	cpu->perf_ctrls.desired_perf = (u64)target_freq * cpu->perf_caps.highest_perf / cppc_dmi_max_khz;
>  	freqs.old = policy->cur;
>  	freqs.new = target_freq;

I am not sure what the calculations should be like, but I don't have
any objections against applying this..

Acked-by: Viresh Kumar <viresh.kumar@linaro.org>

-- 
viresh

  parent reply	other threads:[~2016-10-12  3:29 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-11 21:12 [PATCH] cpufreq: CPPC: Correct desired_perf calculation Hoan Tran
2016-10-11 21:50 ` Rafael J. Wysocki
2016-10-11 22:31   ` Hoan Tran
2016-10-12  3:21 ` Viresh Kumar [this message]
2016-10-12 15:36 ` Prakash, Prashanth
2016-10-12 17:33   ` Hoan Tran

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=20161012032153.GE19385@vireshk-i7 \
    --to=viresh.kumar@linaro.org \
    --cc=ahs3@redhat.com \
    --cc=dhdang@apm.com \
    --cc=hotran@apm.com \
    --cc=lho@apm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=pprakash@codeaurora.org \
    --cc=rjw@rjwysocki.net \
    /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