cpufreq: intel_pstate: Prioritize firmware-provided balance performance EPP
authorSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Mon, 20 Nov 2023 18:59:42 +0000 (10:59 -0800)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 5 Dec 2023 20:29:47 +0000 (21:29 +0100)
commit2719675fa8111a8d7a060133e1dd4797d20c9754
tree050bcb899539b70cef7b30e323310a7ca63e4034
parent33cc938e65a98f1d29d0a18403dbbee050dcad9a
cpufreq: intel_pstate: Prioritize firmware-provided balance performance EPP

The platform firmware can provide a balance performance EPP value by
enabling HWP and programming the EPP to the desired value.

However, currently this only takes effect for processors listed in
intel_epp_balance_perf[], so in order to enable a new processor model
to utilize this mechanism, that table needs to be updated.  It arguably
should not be necessary to modify the kernel to work properly with
every new generation of processors, though, and distributions that don't
always ship the most recent kernels should be able to run reasonably well
on new hardware without code changes.

For this reason, move the check to avoid updating the EPP when the balance
performance EPP is unmodified from the power-up default of 0x80 after the
check that allows the firmware-provided balance performance EPP value to
be retrieved.  This will cause the code to always look for the firmware-
provided value before consulting intel_epp_balance_perf[] and the handling
of new hardware will not depend on whether or not that thable has been
updated yet.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
[ rjw: Subject and changelog edits ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/cpufreq/intel_pstate.c