All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Pandruvada, Srinivas" <srinivas.pandruvada@intel.com>
To: "prarit@redhat.com" <prarit@redhat.com>
Cc: "Brown, Len" <len.brown@intel.com>,
	"kristen@linux.intel.com" <kristen@linux.intel.com>,
	"viresh.kumar@linaro.org" <viresh.kumar@linaro.org>,
	"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
	"rjw@rjwysocki.net" <rjw@rjwysocki.net>,
	"Yates, Alexandra" <alexandra.yates@intel.com>
Subject: Re: [PATCH 2/2] cpufreq, intel_pstate, fix limits->max_perf rounding error
Date: Sat, 21 Nov 2015 00:04:59 +0000	[thread overview]
Message-ID: <1448064298.9857.8.camel@intel.com> (raw)
In-Reply-To: <1448063277-12446-3-git-send-email-prarit@redhat.com>

On Fri, 2015-11-20 at 18:47 -0500, Prarit Bhargava wrote:
> A rounding error was found in the calculation of limits->max_perf
> in intel_pstate_set_policy(), which is used to calculate the max and min
> pstate values in intel_pstate_get_min_max().  In that code,
> limits->max_perf is truncated to 2 hex digits such that, for example,
> 0x169 was incorrectly calculated to 0x16 instead of 0x17.  This resulted in
> the pstate being set one level too low.  This patch rounds the value of
> limits->max_perf up instead of down so that the correct max pstate can
> be reached.
> 
> Cc: Srinivas Pandruvada <srinivas.pandruvada@intel.com>
> Cc: Len Brown <len.brown@intel.com>
> Cc: Alexandra Yates <alexandra.yates@intel.com>
> Cc: Kristen Carlson Accardi <kristen@linux.intel.com>
> Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
> Cc: Viresh Kumar <viresh.kumar@linaro.org>
> Cc: linux-pm@vger.kernel.org
> Signed-off-by: Prarit Bhargava <prarit@redhat.com>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
> ---
>  drivers/cpufreq/intel_pstate.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c
> index eb75053..8ad1f95 100644
> --- a/drivers/cpufreq/intel_pstate.c
> +++ b/drivers/cpufreq/intel_pstate.c
> @@ -1121,6 +1121,7 @@ static int intel_pstate_set_policy(struct cpufreq_policy *policy)
>  				   limits->max_sysfs_pct);
>  	limits->max_perf_pct = max(limits->min_policy_pct,
>  				   limits->max_perf_pct);
> +	limits->max_perf = round_up(limits->max_perf, 8);
>  
>  	/* Make sure min_perf_pct <= max_perf_pct */
>  	limits->min_perf_pct = min(limits->max_perf_pct, limits->min_perf_pct);


  reply	other threads:[~2015-11-21  0:05 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-20 23:47 [PATCH 0/2 v3] cpufreq, intel_pstate, Fix rounding errors Prarit Bhargava
2015-11-20 23:47 ` [PATCH 1/2] cpufreq, intel_pstate, Fix limits->max_policy_pct rounding error Prarit Bhargava
2015-11-21  0:04   ` Pandruvada, Srinivas
2015-11-20 23:47 ` [PATCH 2/2] cpufreq, intel_pstate, fix limits->max_perf " Prarit Bhargava
2015-11-21  0:04   ` Pandruvada, Srinivas [this message]
2015-11-21  2:31 ` [PATCH 0/2 v3] cpufreq, intel_pstate, Fix rounding errors Viresh Kumar
2015-11-23 22:46   ` Rafael J. Wysocki
  -- strict thread matches above, loose matches on Subject: below --
2015-11-20 12:32 [PATCH 0/2 v2] " Prarit Bhargava
2015-11-20 12:32 ` [PATCH 2/2] cpufreq, intel_pstate, fix limits->max_perf rounding error Prarit Bhargava

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=1448064298.9857.8.camel@intel.com \
    --to=srinivas.pandruvada@intel.com \
    --cc=alexandra.yates@intel.com \
    --cc=kristen@linux.intel.com \
    --cc=len.brown@intel.com \
    --cc=linux-pm@vger.kernel.org \
    --cc=prarit@redhat.com \
    --cc=rjw@rjwysocki.net \
    --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.