Skip to content

Commit 03f44ff

Browse files
Tero Kristorafaeljw
authored andcommitted
cpufreq: intel_pstate: Fix energy_performance_preference for passive
If the intel_pstate driver is set to passive mode, then writing the same value to the energy_performance_preference sysfs twice will fail. This is caused by the wrong return value used (index of the matched energy_perf_string), instead of the length of the passed in parameter. Fix by forcing the internal return value to zero when the same preference is passed in by user. This same issue is not present when active mode is used for the driver. Fixes: f6ebbcf ("cpufreq: intel_pstate: Implement passive mode with HWP enabled") Reported-by: Niklas Neronin <niklas.neronin@intel.com> Signed-off-by: Tero Kristo <tero.kristo@linux.intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent c88ad30 commit 03f44ff

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

drivers/cpufreq/intel_pstate.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -824,6 +824,8 @@ static ssize_t store_energy_performance_preference(
824824
err = cpufreq_start_governor(policy);
825825
if (!ret)
826826
ret = err;
827+
} else {
828+
ret = 0;
827829
}
828830
}
829831

0 commit comments

Comments
 (0)