public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Keyon Jie <yang.jie@linux.intel.com>
Cc: Doug Smythies <dsmythies@telus.net>,
	stable@vger.kernel.org,
	"Rafael J . Wysocki" <rafael.j.wysocki@intel.com>
Subject: Re: [PATCH] cpufreq: intel_pstate: set stale CPU frequency to minimum
Date: Thu, 7 Sep 2023 11:14:44 +0100	[thread overview]
Message-ID: <2023090715-buffalo-zesty-b746@gregkh> (raw)
In-Reply-To: <20230906001646.338935-1-yang.jie@linux.intel.com>

On Tue, Sep 05, 2023 at 05:16:46PM -0700, Keyon Jie wrote:
> From: Doug Smythies <dsmythies@telus.net>
> 
> commit d51847acb018d83186e4af67bc93f9a00a8644f7 upstream.
> 
> This fix applies to all stable kernel versions 5.18+.
> 
> The intel_pstate CPU frequency scaling driver does not
> use policy->cur and it is 0.
> When the CPU frequency is outdated arch_freq_get_on_cpu()
> will default to the nominal clock frequency when its call to
> cpufreq_quick_getpolicy_cur returns the never updated 0.
> Thus, the listed frequency might be outside of currently
> set limits. Some users are complaining about the high
> reported frequency, albeit stale, when their system is
> idle and/or it is above the reduced maximum they have set.
> 
> This patch will maintain policy_cur for the intel_pstate
> driver at the current minimum CPU frequency.
> 
> Reported-by: Yang Jie <yang.jie@linux.intel.com>
> Closes: https://bugzilla.kernel.org/show_bug.cgi?id=217597
> Signed-off-by: Doug Smythies <dsmythies@telus.net>
> [ rjw: White space damage fixes and comment adjustment ]
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
> ---
>  drivers/cpufreq/intel_pstate.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c
> index d51f90f55c05..fbe3a4098743 100644
> --- a/drivers/cpufreq/intel_pstate.c
> +++ b/drivers/cpufreq/intel_pstate.c
> @@ -2574,6 +2574,11 @@ static int intel_pstate_set_policy(struct cpufreq_policy *policy)
>  			intel_pstate_clear_update_util_hook(policy->cpu);
>  		intel_pstate_hwp_set(policy->cpu);
>  	}
> +	/*
> +	 * policy->cur is never updated with the intel_pstate driver, but it
> +	 * is used as a stale frequency value. So, keep it within limits.
> +	 */
> +	policy->cur = policy->min;
>  
>  	mutex_unlock(&intel_pstate_limits_lock);
>  

Now queued up, thanks.

greg k-h

      parent reply	other threads:[~2023-09-07 17:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-06  0:16 [PATCH] cpufreq: intel_pstate: set stale CPU frequency to minimum Keyon Jie
2023-09-06  8:38 ` Greg Kroah-Hartman
2023-09-06 16:42   ` Keyon Jie
2023-09-07 10:14 ` Greg Kroah-Hartman [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=2023090715-buffalo-zesty-b746@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=dsmythies@telus.net \
    --cc=rafael.j.wysocki@intel.com \
    --cc=stable@vger.kernel.org \
    --cc=yang.jie@linux.intel.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