diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2019-03-30 13:06:09 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2019-03-30 13:06:09 -0400 |
commit | 8e377a1c7e2465831b39dbe24ec04c0a8b36fc76 (patch) | |
tree | 48df2b71c4e1045922cce85f0145a1f15a099a2a | |
parent | 12195302ee6c32cf3c0fa947e17303ce583d41c9 (diff) | |
parent | 31d4c528cea4023cf36f6148c03bb960cedefeef (diff) |
Merge tag 'pm-5.1-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull power management fixes from Rafael Wysocki:
"These fix CPU base frequency reporting in the intel_pstate driver and
a use-after-free in the scpi-cpufreq driver.
Specifics:
- Fix the ACPI CPPC library to actually follow the specification when
decoding the guaranteed performance register information and make
the intel_pstate driver to fall back to the nominal frequency when
reporting the base frequency if the guaranteed performance register
information is not there (Srinivas Pandruvada).
- Fix use-after-free in the exit callback of the scpi-cpufreq left
after an update during the 5.0 development cycle (Vincent Stehlé)"
* tag 'pm-5.1-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
cpufreq: scpi: Fix use after free
cpufreq: intel_pstate: Also use CPPC nominal_perf for base_frequency
ACPI / CPPC: Fix guaranteed performance handling
-rw-r--r-- | drivers/acpi/cppc_acpi.c | 9 | ||||
-rw-r--r-- | drivers/cpufreq/intel_pstate.c | 5 | ||||
-rw-r--r-- | drivers/cpufreq/scpi-cpufreq.c | 2 |
3 files changed, 12 insertions, 4 deletions
diff --git a/drivers/acpi/cppc_acpi.c b/drivers/acpi/cppc_acpi.c index 1b207fca1420..d4244e7d0e38 100644 --- a/drivers/acpi/cppc_acpi.c +++ b/drivers/acpi/cppc_acpi.c | |||
@@ -1150,8 +1150,13 @@ int cppc_get_perf_caps(int cpunum, struct cppc_perf_caps *perf_caps) | |||
1150 | cpc_read(cpunum, nominal_reg, &nom); | 1150 | cpc_read(cpunum, nominal_reg, &nom); |
1151 | perf_caps->nominal_perf = nom; | 1151 | perf_caps->nominal_perf = nom; |
1152 | 1152 | ||
1153 | cpc_read(cpunum, guaranteed_reg, &guaranteed); | 1153 | if (guaranteed_reg->type != ACPI_TYPE_BUFFER || |
1154 | perf_caps->guaranteed_perf = guaranteed; | 1154 | IS_NULL_REG(&guaranteed_reg->cpc_entry.reg)) { |
1155 | perf_caps->guaranteed_perf = 0; | ||
1156 | } else { | ||
1157 | cpc_read(cpunum, guaranteed_reg, &guaranteed); | ||
1158 | perf_caps->guaranteed_perf = guaranteed; | ||
1159 | } | ||
1155 | 1160 | ||
1156 | cpc_read(cpunum, lowest_non_linear_reg, &min_nonlinear); | 1161 | cpc_read(cpunum, lowest_non_linear_reg, &min_nonlinear); |
1157 | perf_caps->lowest_nonlinear_perf = min_nonlinear; | 1162 | perf_caps->lowest_nonlinear_perf = min_nonlinear; |
diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c index e22f0dbaebb1..b599c7318aab 100644 --- a/drivers/cpufreq/intel_pstate.c +++ b/drivers/cpufreq/intel_pstate.c | |||
@@ -385,7 +385,10 @@ static int intel_pstate_get_cppc_guranteed(int cpu) | |||
385 | if (ret) | 385 | if (ret) |
386 | return ret; | 386 | return ret; |
387 | 387 | ||
388 | return cppc_perf.guaranteed_perf; | 388 | if (cppc_perf.guaranteed_perf) |
389 | return cppc_perf.guaranteed_perf; | ||
390 | |||
391 | return cppc_perf.nominal_perf; | ||
389 | } | 392 | } |
390 | 393 | ||
391 | #else /* CONFIG_ACPI_CPPC_LIB */ | 394 | #else /* CONFIG_ACPI_CPPC_LIB */ |
diff --git a/drivers/cpufreq/scpi-cpufreq.c b/drivers/cpufreq/scpi-cpufreq.c index 3f49427766b8..2b51e0718c9f 100644 --- a/drivers/cpufreq/scpi-cpufreq.c +++ b/drivers/cpufreq/scpi-cpufreq.c | |||
@@ -189,8 +189,8 @@ static int scpi_cpufreq_exit(struct cpufreq_policy *policy) | |||
189 | 189 | ||
190 | clk_put(priv->clk); | 190 | clk_put(priv->clk); |
191 | dev_pm_opp_free_cpufreq_table(priv->cpu_dev, &policy->freq_table); | 191 | dev_pm_opp_free_cpufreq_table(priv->cpu_dev, &policy->freq_table); |
192 | kfree(priv); | ||
193 | dev_pm_opp_remove_all_dynamic(priv->cpu_dev); | 192 | dev_pm_opp_remove_all_dynamic(priv->cpu_dev); |
193 | kfree(priv); | ||
194 | 194 | ||
195 | return 0; | 195 | return 0; |
196 | } | 196 | } |