Skip to content

Commit 18605e9

Browse files
committed
cpufreq: intel_pstate: Fix hwp_get_cpu_scaling()
Commit b52aaee ("cpufreq: intel_pstate: Avoid SMP calls to get cpu-type") introduced two issues into hwp_get_cpu_scaling(). First, it made that function use the CPU type of the CPU running the code even though the target CPU is passed as the argument to it and second, it used smp_processor_id() for that even though hwp_get_cpu_scaling() runs in preemptible context. Fix both of these problems by simply passing "cpu" to cpu_data(). Fixes: b52aaee ("cpufreq: intel_pstate: Avoid SMP calls to get cpu-type") Link: https://lore.kernel.org/linux-pm/20250412103434.5321-1-xry111@xry111.site/ Reported-by: Xi Ruoyao <xry111@xry111.site> Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Link: https://patch.msgid.link/12659608.O9o76ZdvQC@rjwysocki.net
1 parent 8ffd015 commit 18605e9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/cpufreq/intel_pstate.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2209,7 +2209,7 @@ static int knl_get_turbo_pstate(int cpu)
22092209
static int hwp_get_cpu_scaling(int cpu)
22102210
{
22112211
if (hybrid_scaling_factor) {
2212-
struct cpuinfo_x86 *c = &cpu_data(smp_processor_id());
2212+
struct cpuinfo_x86 *c = &cpu_data(cpu);
22132213
u8 cpu_type = c->topo.intel_type;
22142214

22152215
/*

0 commit comments

Comments
 (0)