Skip to content

Commit f32587d

Browse files
committed
cpufreq: intel_pstate: Replace three global.turbo_disabled checks
Replace the global.turbo_disabled in __intel_pstate_update_max_freq() with a global.no_turbo one to make store_no_turbo() actually update the maximum CPU frequency on the trubo preference changes, which needs to be consistent with arch_set_max_freq_ratio() called from there. For more consistency, replace the global.turbo_disabled checks in __intel_pstate_cpu_init() and intel_cpufreq_adjust_perf() with global.no_turbo checks either. Signed-off-by: Rafael J. Wysocki <[email protected]> Acked-by: Srinivas Pandruvada <[email protected]>
1 parent 9558fae commit f32587d

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

drivers/cpufreq/intel_pstate.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1153,7 +1153,7 @@ static void intel_pstate_update_policies(void)
11531153
static void __intel_pstate_update_max_freq(struct cpudata *cpudata,
11541154
struct cpufreq_policy *policy)
11551155
{
1156-
policy->cpuinfo.max_freq = global.turbo_disabled ?
1156+
policy->cpuinfo.max_freq = READ_ONCE(global.no_turbo) ?
11571157
cpudata->pstate.max_freq : cpudata->pstate.turbo_freq;
11581158
refresh_frequency_limits(policy);
11591159
}
@@ -2704,7 +2704,7 @@ static int __intel_pstate_cpu_init(struct cpufreq_policy *policy)
27042704

27052705
/* cpuinfo and default policy values */
27062706
policy->cpuinfo.min_freq = cpu->pstate.min_freq;
2707-
policy->cpuinfo.max_freq = global.turbo_disabled ?
2707+
policy->cpuinfo.max_freq = READ_ONCE(global.no_turbo) ?
27082708
cpu->pstate.max_freq : cpu->pstate.turbo_freq;
27092709

27102710
policy->min = policy->cpuinfo.min_freq;
@@ -2907,8 +2907,9 @@ static void intel_cpufreq_adjust_perf(unsigned int cpunum,
29072907
int old_pstate = cpu->pstate.current_pstate;
29082908
int cap_pstate, min_pstate, max_pstate, target_pstate;
29092909

2910-
cap_pstate = global.turbo_disabled ? HWP_GUARANTEED_PERF(hwp_cap) :
2911-
HWP_HIGHEST_PERF(hwp_cap);
2910+
cap_pstate = READ_ONCE(global.no_turbo) ?
2911+
HWP_GUARANTEED_PERF(hwp_cap) :
2912+
HWP_HIGHEST_PERF(hwp_cap);
29122913

29132914
/* Optimization: Avoid unnecessary divisions. */
29142915

0 commit comments

Comments
 (0)