All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rafael@kernel.org>
To: Doug Smythies <dsmythies@telus.net>
Cc: srinivas.pandruvada@linux.intel.com, rafael@kernel.org,
	lenb@kernel.org,  linux-kernel@vger.kernel.org,
	linux-pm@vger.kernel.org,  vincent.guittot@linaro.org
Subject: Re: [PATCH] cpufreq: intel_pstate: fix pstate limits enforcement for adjust_perf call back
Date: Thu, 22 Feb 2024 20:13:33 +0100	[thread overview]
Message-ID: <CAJZ5v0gWPQhgmD1nCxJQhwzvUxVuCMghT28AkqCMGk-pHkuwrQ@mail.gmail.com> (raw)
In-Reply-To: <20240217213010.2466-1-dsmythies@telus.net>

On Sat, Feb 17, 2024 at 10:30 PM Doug Smythies <dsmythies@telus.net> wrote:
>
> There is a loophole in pstate limit clamping for the intel_cpufreq CPU
> frequency scaling driver (intel_pstate in passive mode), schedutil CPU
> frequency scaling governor, HWP (HardWare Pstate) control enabled, when
> the adjust_perf call back path is used.
>
> Fix it.
>
> Signed-off-by: Doug Smythies <dsmythies@telus.net>
> ---
>  drivers/cpufreq/intel_pstate.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c
> index ca94e60e705a..79619227ea51 100644
> --- a/drivers/cpufreq/intel_pstate.c
> +++ b/drivers/cpufreq/intel_pstate.c
> @@ -2987,6 +2987,9 @@ static void intel_cpufreq_adjust_perf(unsigned int cpunum,
>         if (min_pstate < cpu->min_perf_ratio)
>                 min_pstate = cpu->min_perf_ratio;
>
> +       if (min_pstate > cpu->max_perf_ratio)
> +               min_pstate = cpu->max_perf_ratio;
> +
>         max_pstate = min(cap_pstate, cpu->max_perf_ratio);
>         if (max_pstate < min_pstate)
>                 max_pstate = min_pstate;
> --

Applied as 6.9 material, thanks!

      reply	other threads:[~2024-02-22 19:13 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-17 21:30 [PATCH] cpufreq: intel_pstate: fix pstate limits enforcement for adjust_perf call back Doug Smythies
2024-02-22 19:13 ` Rafael J. Wysocki [this message]

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=CAJZ5v0gWPQhgmD1nCxJQhwzvUxVuCMghT28AkqCMGk-pHkuwrQ@mail.gmail.com \
    --to=rafael@kernel.org \
    --cc=dsmythies@telus.net \
    --cc=lenb@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=srinivas.pandruvada@linux.intel.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 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.