Commit db441bd9 authored by Giovanni Gherdovich's avatar Giovanni Gherdovich Committed by Peter Zijlstra

x86, sched: Move check for CPU type to caller function

Improve readability of the function intel_set_max_freq_ratio() by moving
the check for KNL CPUs there, together with checks for GLM and SKX.
Signed-off-by: default avatarGiovanni Gherdovich <ggherdovich@suse.cz>
Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
Link: https://lkml.kernel.org/r/20200416054745.740-5-ggherdovich@suse.cz
parent b56e7d45
...@@ -1877,9 +1877,6 @@ static bool knl_set_max_freq_ratio(u64 *base_freq, u64 *turbo_freq, ...@@ -1877,9 +1877,6 @@ static bool knl_set_max_freq_ratio(u64 *base_freq, u64 *turbo_freq,
int err, i; int err, i;
u64 msr; u64 msr;
if (!x86_match_cpu(has_knl_turbo_ratio_limits))
return false;
err = rdmsrl_safe(MSR_PLATFORM_INFO, base_freq); err = rdmsrl_safe(MSR_PLATFORM_INFO, base_freq);
if (err) if (err)
return false; return false;
...@@ -1977,7 +1974,8 @@ static bool intel_set_max_freq_ratio(void) ...@@ -1977,7 +1974,8 @@ static bool intel_set_max_freq_ratio(void)
skx_set_max_freq_ratio(&base_freq, &turbo_freq, 1)) skx_set_max_freq_ratio(&base_freq, &turbo_freq, 1))
goto out; goto out;
if (knl_set_max_freq_ratio(&base_freq, &turbo_freq, 1)) if (x86_match_cpu(has_knl_turbo_ratio_limits) &&
knl_set_max_freq_ratio(&base_freq, &turbo_freq, 1))
goto out; goto out;
if (x86_match_cpu(has_skx_turbo_ratio_limits) && if (x86_match_cpu(has_skx_turbo_ratio_limits) &&
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment