Linux Power Management development
 help / color / mirror / Atom feed
* [PATCH v1] cpufreq: intel_pstate: Always use HWP_DESIRED_PERF in passive mode
@ 2025-06-16 18:19 Rafael J. Wysocki
  2025-07-14  7:58 ` Shashank Balaji
  0 siblings, 1 reply; 2+ messages in thread
From: Rafael J. Wysocki @ 2025-06-16 18:19 UTC (permalink / raw)
  To: Linux PM; +Cc: LKML, Srinivas Pandruvada, Shashank Balaji, Russell Haley

From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

In the passive mode, intel_cpufreq_update_pstate() sets HWP_MIN_PERF in
accordance with the target frequency to ensure delivering adequate
performance, but it sets HWP_DESIRED_PERF to 0, so the processor has no
indication that the desired performance level is actually equal to the
floor one.  This may cause it to choose a performance point way above
the desired level.

Moreover, this is inconsistent with intel_cpufreq_adjust_perf() which
actually sets HWP_DESIRED_PERF in accordance with the target performance
value.

Address this by adjusting intel_cpufreq_update_pstate() to pass
target_pstate as both the minimum and the desired performance levels
to intel_cpufreq_hwp_update().

Fixes: a365ab6b9dfb ("cpufreq: intel_pstate: Implement the ->adjust_perf() callback")
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
 drivers/cpufreq/intel_pstate.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/drivers/cpufreq/intel_pstate.c
+++ b/drivers/cpufreq/intel_pstate.c
@@ -3249,8 +3249,8 @@
 		int max_pstate = policy->strict_target ?
 					target_pstate : cpu->max_perf_ratio;
 
-		intel_cpufreq_hwp_update(cpu, target_pstate, max_pstate, 0,
-					 fast_switch);
+		intel_cpufreq_hwp_update(cpu, target_pstate, max_pstate,
+					 target_pstate, fast_switch);
 	} else if (target_pstate != old_pstate) {
 		intel_cpufreq_perf_ctl_update(cpu, target_pstate, fast_switch);
 	}




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-07-14  8:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-16 18:19 [PATCH v1] cpufreq: intel_pstate: Always use HWP_DESIRED_PERF in passive mode Rafael J. Wysocki
2025-07-14  7:58 ` Shashank Balaji

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox