* [PATCH RESEND] cpufreq: intel_pstate: Sync policy->cur when setting min pstate during CPU offline
@ 2026-05-19 11:24 Fushuai Wang
2026-05-19 17:56 ` srinivas pandruvada
0 siblings, 1 reply; 2+ messages in thread
From: Fushuai Wang @ 2026-05-19 11:24 UTC (permalink / raw)
To: srinivas.pandruvada, lenb, rafael, viresh.kumar, currojerez
Cc: linux-pm, linux-kernel, wangfushuai
From: Fushuai Wang <wangfushuai@baidu.com>
When a CPU goes offline with HWP disabled, intel_pstate_set_min_pstate()
sets the MSR_IA32_PERF_CTL to minimum frequency to prevent SMT siblings
from being restricted. However, the policy->cur value was not updated,
leaving it at the previous value.
When the CPU comes back online, governor->limits() checks if target_freq
equals policy->cur and skips the frequency adjustment if they match. Since
policy->cur still holds the previous value, the governor does not call
cpufreq_driver->target to update MSR_IA32_PERF_CTL.
Fix this by synchronizing policy->cur with the hardware state when setting
minimum pstate during CPU offline.
Fixes: f6ebbcf08f37 ("cpufreq: intel_pstate: Implement passive mode with HWP enabled")
Signed-off-by: Fushuai Wang <wangfushuai@baidu.com>
---
drivers/cpufreq/intel_pstate.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c
index 1292da53e5fc..0bd6388caa9d 100644
--- a/drivers/cpufreq/intel_pstate.c
+++ b/drivers/cpufreq/intel_pstate.c
@@ -2986,8 +2986,10 @@ static int intel_cpufreq_cpu_offline(struct cpufreq_policy *policy)
*/
if (hwp_active)
intel_pstate_hwp_offline(cpu);
- else
+ else {
intel_pstate_set_min_pstate(cpu);
+ policy->cur = cpu->pstate.min_freq;
+ }
intel_pstate_exit_perf_limits(policy);
--
2.36.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH RESEND] cpufreq: intel_pstate: Sync policy->cur when setting min pstate during CPU offline
2026-05-19 11:24 [PATCH RESEND] cpufreq: intel_pstate: Sync policy->cur when setting min pstate during CPU offline Fushuai Wang
@ 2026-05-19 17:56 ` srinivas pandruvada
0 siblings, 0 replies; 2+ messages in thread
From: srinivas pandruvada @ 2026-05-19 17:56 UTC (permalink / raw)
To: Fushuai Wang, lenb, rafael, viresh.kumar, currojerez
Cc: linux-pm, linux-kernel, wangfushuai
On Tue, 2026-05-19 at 19:24 +0800, Fushuai Wang wrote:
> From: Fushuai Wang <wangfushuai@baidu.com>
>
> When a CPU goes offline with HWP disabled,
> intel_pstate_set_min_pstate()
> sets the MSR_IA32_PERF_CTL to minimum frequency to prevent SMT
> siblings
> from being restricted. However, the policy->cur value was not
> updated,
> leaving it at the previous value.
>
> When the CPU comes back online, governor->limits() checks if
> target_freq
> equals policy->cur and skips the frequency adjustment if they match.
> Since
> policy->cur still holds the previous value, the governor does not
> call
> cpufreq_driver->target to update MSR_IA32_PERF_CTL.
>
> Fix this by synchronizing policy->cur with the hardware state when
> setting
> minimum pstate during CPU offline.
>
> Fixes: f6ebbcf08f37 ("cpufreq: intel_pstate: Implement passive mode
> with HWP enabled")
The patch is fine with some comments below, but this Fixes tag is not
necessary added this. This was implementation from
Commit bb18008f8086283f8f03e8e50fbbf17f213b9ea9
Author: Dirk Brandewie <dirk.j.brandewie@intel.com>
Date: Wed Mar 19 08:45:54 2014 -0700
intel_pstate: Set core to min P state during core offline
> Signed-off-by: Fushuai Wang <wangfushuai@baidu.com>
> ---
> drivers/cpufreq/intel_pstate.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/cpufreq/intel_pstate.c
> b/drivers/cpufreq/intel_pstate.c
> index 1292da53e5fc..0bd6388caa9d 100644
> --- a/drivers/cpufreq/intel_pstate.c
> +++ b/drivers/cpufreq/intel_pstate.c
> @@ -2986,8 +2986,10 @@ static int intel_cpufreq_cpu_offline(struct
> cpufreq_policy *policy)
> */
> if (hwp_active)
{
> intel_pstate_hwp_offline(cpu);
> - else
> + else {
s/else / } else {
> intel_pstate_set_min_pstate(cpu);
> + policy->cur = cpu->pstate.min_freq;
> + }
>
> intel_pstate_exit_perf_limits(policy);
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-05-19 17:56 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-19 11:24 [PATCH RESEND] cpufreq: intel_pstate: Sync policy->cur when setting min pstate during CPU offline Fushuai Wang
2026-05-19 17:56 ` srinivas pandruvada
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox