diff options
Diffstat (limited to 'drivers/cpufreq/intel_pstate.c')
-rw-r--r-- | drivers/cpufreq/intel_pstate.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c index a54d65aa776d..50bd6d987fc3 100644 --- a/drivers/cpufreq/intel_pstate.c +++ b/drivers/cpufreq/intel_pstate.c | |||
@@ -1235,6 +1235,25 @@ static void intel_pstate_hwp_enable(struct cpudata *cpudata) | |||
1235 | cpudata->epp_default = intel_pstate_get_epp(cpudata, 0); | 1235 | cpudata->epp_default = intel_pstate_get_epp(cpudata, 0); |
1236 | } | 1236 | } |
1237 | 1237 | ||
1238 | #define MSR_IA32_POWER_CTL_BIT_EE 19 | ||
1239 | |||
1240 | /* Disable energy efficiency optimization */ | ||
1241 | static void intel_pstate_disable_ee(int cpu) | ||
1242 | { | ||
1243 | u64 power_ctl; | ||
1244 | int ret; | ||
1245 | |||
1246 | ret = rdmsrl_on_cpu(cpu, MSR_IA32_POWER_CTL, &power_ctl); | ||
1247 | if (ret) | ||
1248 | return; | ||
1249 | |||
1250 | if (!(power_ctl & BIT(MSR_IA32_POWER_CTL_BIT_EE))) { | ||
1251 | pr_info("Disabling energy efficiency optimization\n"); | ||
1252 | power_ctl |= BIT(MSR_IA32_POWER_CTL_BIT_EE); | ||
1253 | wrmsrl_on_cpu(cpu, MSR_IA32_POWER_CTL, power_ctl); | ||
1254 | } | ||
1255 | } | ||
1256 | |||
1238 | static int atom_get_min_pstate(void) | 1257 | static int atom_get_min_pstate(void) |
1239 | { | 1258 | { |
1240 | u64 value; | 1259 | u64 value; |
@@ -1845,6 +1864,11 @@ static const struct x86_cpu_id intel_pstate_cpu_oob_ids[] __initconst = { | |||
1845 | {} | 1864 | {} |
1846 | }; | 1865 | }; |
1847 | 1866 | ||
1867 | static const struct x86_cpu_id intel_pstate_cpu_ee_disable_ids[] = { | ||
1868 | ICPU(INTEL_FAM6_KABYLAKE_DESKTOP, core_params), | ||
1869 | {} | ||
1870 | }; | ||
1871 | |||
1848 | static int intel_pstate_init_cpu(unsigned int cpunum) | 1872 | static int intel_pstate_init_cpu(unsigned int cpunum) |
1849 | { | 1873 | { |
1850 | struct cpudata *cpu; | 1874 | struct cpudata *cpu; |
@@ -1875,6 +1899,12 @@ static int intel_pstate_init_cpu(unsigned int cpunum) | |||
1875 | cpu->cpu = cpunum; | 1899 | cpu->cpu = cpunum; |
1876 | 1900 | ||
1877 | if (hwp_active) { | 1901 | if (hwp_active) { |
1902 | const struct x86_cpu_id *id; | ||
1903 | |||
1904 | id = x86_match_cpu(intel_pstate_cpu_ee_disable_ids); | ||
1905 | if (id) | ||
1906 | intel_pstate_disable_ee(cpunum); | ||
1907 | |||
1878 | intel_pstate_hwp_enable(cpu); | 1908 | intel_pstate_hwp_enable(cpu); |
1879 | pid_params.sample_rate_ms = 50; | 1909 | pid_params.sample_rate_ms = 50; |
1880 | pid_params.sample_rate_ns = 50 * NSEC_PER_MSEC; | 1910 | pid_params.sample_rate_ns = 50 * NSEC_PER_MSEC; |