Commit 8e377a1c authored by Linus Torvalds's avatar Linus Torvalds

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
parents 12195302 31d4c528
...@@ -1150,8 +1150,13 @@ int cppc_get_perf_caps(int cpunum, struct cppc_perf_caps *perf_caps) ...@@ -1150,8 +1150,13 @@ int cppc_get_perf_caps(int cpunum, struct cppc_perf_caps *perf_caps)
cpc_read(cpunum, nominal_reg, &nom); cpc_read(cpunum, nominal_reg, &nom);
perf_caps->nominal_perf = nom; perf_caps->nominal_perf = nom;
if (guaranteed_reg->type != ACPI_TYPE_BUFFER ||
IS_NULL_REG(&guaranteed_reg->cpc_entry.reg)) {
perf_caps->guaranteed_perf = 0;
} else {
cpc_read(cpunum, guaranteed_reg, &guaranteed); cpc_read(cpunum, guaranteed_reg, &guaranteed);
perf_caps->guaranteed_perf = guaranteed; perf_caps->guaranteed_perf = guaranteed;
}
cpc_read(cpunum, lowest_non_linear_reg, &min_nonlinear); cpc_read(cpunum, lowest_non_linear_reg, &min_nonlinear);
perf_caps->lowest_nonlinear_perf = min_nonlinear; perf_caps->lowest_nonlinear_perf = min_nonlinear;
......
...@@ -385,7 +385,10 @@ static int intel_pstate_get_cppc_guranteed(int cpu) ...@@ -385,7 +385,10 @@ static int intel_pstate_get_cppc_guranteed(int cpu)
if (ret) if (ret)
return ret; return ret;
if (cppc_perf.guaranteed_perf)
return cppc_perf.guaranteed_perf; return cppc_perf.guaranteed_perf;
return cppc_perf.nominal_perf;
} }
#else /* CONFIG_ACPI_CPPC_LIB */ #else /* CONFIG_ACPI_CPPC_LIB */
......
...@@ -189,8 +189,8 @@ static int scpi_cpufreq_exit(struct cpufreq_policy *policy) ...@@ -189,8 +189,8 @@ static int scpi_cpufreq_exit(struct cpufreq_policy *policy)
clk_put(priv->clk); clk_put(priv->clk);
dev_pm_opp_free_cpufreq_table(priv->cpu_dev, &policy->freq_table); dev_pm_opp_free_cpufreq_table(priv->cpu_dev, &policy->freq_table);
kfree(priv);
dev_pm_opp_remove_all_dynamic(priv->cpu_dev); dev_pm_opp_remove_all_dynamic(priv->cpu_dev);
kfree(priv);
return 0; return 0;
} }
......
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