Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8e377a1c authored by Linus Torvalds's avatar Linus Torvalds
Browse files
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
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -1150,8 +1150,13 @@ int cppc_get_perf_caps(int cpunum, struct cppc_perf_caps *perf_caps)
	cpc_read(cpunum, nominal_reg, &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);
		perf_caps->guaranteed_perf = guaranteed;
	}

	cpc_read(cpunum, lowest_non_linear_reg, &min_nonlinear);
	perf_caps->lowest_nonlinear_perf = min_nonlinear;
+4 −1
Original line number Diff line number Diff line
@@ -385,7 +385,10 @@ static int intel_pstate_get_cppc_guranteed(int cpu)
	if (ret)
		return ret;

	if (cppc_perf.guaranteed_perf)
		return cppc_perf.guaranteed_perf;

	return cppc_perf.nominal_perf;
}

#else /* CONFIG_ACPI_CPPC_LIB */
+1 −1
Original line number Diff line number Diff line
@@ -189,8 +189,8 @@ static int scpi_cpufreq_exit(struct cpufreq_policy *policy)

	clk_put(priv->clk);
	dev_pm_opp_free_cpufreq_table(priv->cpu_dev, &policy->freq_table);
	kfree(priv);
	dev_pm_opp_remove_all_dynamic(priv->cpu_dev);
	kfree(priv);

	return 0;
}