[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAJZ5v0gWPQhgmD1nCxJQhwzvUxVuCMghT28AkqCMGk-pHkuwrQ@mail.gmail.com>
Date: Thu, 22 Feb 2024 20:13:33 +0100
From: "Rafael J. Wysocki" <rafael@...nel.org>
To: Doug Smythies <dsmythies@...us.net>
Cc: srinivas.pandruvada@...ux.intel.com, rafael@...nel.org, lenb@...nel.org,
linux-kernel@...r.kernel.org, linux-pm@...r.kernel.org,
vincent.guittot@...aro.org
Subject: Re: [PATCH] cpufreq: intel_pstate: fix pstate limits enforcement for
adjust_perf call back
On Sat, Feb 17, 2024 at 10:30 PM Doug Smythies <dsmythies@...us.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@...us.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!
Powered by blists - more mailing lists