Skip to content

Commit 2719675

Browse files
spandruvadarafaeljw
authored andcommitted
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>
1 parent 33cc938 commit 2719675

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

drivers/cpufreq/intel_pstate.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1691,13 +1691,6 @@ static void intel_pstate_update_epp_defaults(struct cpudata *cpudata)
16911691
{
16921692
cpudata->epp_default = intel_pstate_get_epp(cpudata, 0);
16931693

1694-
/*
1695-
* If this CPU gen doesn't call for change in balance_perf
1696-
* EPP return.
1697-
*/
1698-
if (epp_values[EPP_INDEX_BALANCE_PERFORMANCE] == HWP_EPP_BALANCE_PERFORMANCE)
1699-
return;
1700-
17011694
/*
17021695
* If the EPP is set by firmware, which means that firmware enabled HWP
17031696
* - Is equal or less than 0x80 (default balance_perf EPP)
@@ -1710,6 +1703,13 @@ static void intel_pstate_update_epp_defaults(struct cpudata *cpudata)
17101703
return;
17111704
}
17121705

1706+
/*
1707+
* If this CPU gen doesn't call for change in balance_perf
1708+
* EPP return.
1709+
*/
1710+
if (epp_values[EPP_INDEX_BALANCE_PERFORMANCE] == HWP_EPP_BALANCE_PERFORMANCE)
1711+
return;
1712+
17131713
/*
17141714
* Use hard coded value per gen to update the balance_perf
17151715
* and default EPP.

0 commit comments

Comments
 (0)