Power management fixes for v4.7-rc6

- Fix a recent intel_pstate regression that caused the number of
    wakeups to increase significantly on an idle system in some cases
    due to excessive synchronize_sched() invocations (Rafael Wysocki).
 
  - Fix unnecessary invocations of WARN_ON() in the cpufreq core
    after cpufreq has been suspended introduced during the 4.6 cycla
    (Rafael Wysocki).
 
  - Fix an error code path in the cpufreq-dt-platdev driver that
    forgets to drop a reference to a DT node (Masahiro Yamada).
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.22 (GNU/Linux)
 
 iQIcBAABCAAGBQJXdtQFAAoJEILEb/54YlRxZEkQAKHFWVRGwIGRT4mF6Tx8P6PN
 mg+9fQbTKAKNFnNZZp6xGhch97s1sIWf5GPRTS72zZkP8oHLERNphVhh7ucPslk7
 XicBaawxmwIAlalcB8S8I/i8hGZqwYpTgpPx0DsDxA8E9XJLnELmiJpiB520FoQp
 Ym+PzbE5LHHPdxZrNhzMejfOvi5X1svFvRQRxTnHF638kfOJswmABX0WRGyYjtHP
 FDasdVv+S7JbJhCP/nOTVW50/Scao67nL8GqtiovYjWPBq85+WYAo63qHK46XwlG
 NgOMIqVfdb89e7aoPmlHW/FS9QAqQYOsK+pZv+fimRCAMottu1XEXLSzBzQYQSqU
 RYW3cJkyf06F4Vk+7Jpgdujia4Fv2OBU1qQKmvvlXyPLZVhssTfTECx/kkEiQtrK
 Id8rzlyYaPIDRdpG1cOWH3my8Ypv75EWvuDnBlBojweiq+1twcncLbIBRmY0HMCB
 QAcnxZTqNHq5lacgyixwOPKIkSRoXT0dFt6hnGX0CE9NdiplhSltQ/uBmDNz6Asi
 nRq2A+3Bwv6uc5PlHr4IfA4xZ7f8oAxj42dybAOgAM0dU89LjmOtaLCtYDxH6mSk
 xQBTe3R6tLbFK++lI5XBgjRRxbrwixXIZFwK6bdJnESVf8+UH4I1SbkwoXf0cxtx
 jTQ1C2XLx5oxdvTE2J60
 =+apA
 -----END PGP SIGNATURE-----

Merge tag 'pm-4.7-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm

Pull power management fixes from Rafael Wysocki:
 "Three cpufreq fixes, one in the core (stable-candidate) and two in
  drivers (intel_pstate and cpufreq-dt).

  Specifics:

   - Fix a recent intel_pstate regression that caused the number of
     wakeups to increase significantly on an idle system in some cases
     due to excessive synchronize_sched() invocations (Rafael Wysocki).

   - Fix unnecessary invocations of WARN_ON() in the cpufreq core after
     cpufreq has been suspended introduced during the 4.6 cycla (Rafael
     Wysocki).

   - Fix an error code path in the cpufreq-dt-platdev driver that
     forgets to drop a reference to a DT node (Masahiro Yamada)"

* tag 'pm-4.7-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
  cpufreq: Avoid false-positive WARN_ON()s in cpufreq_update_policy()
  cpufreq: dt: call of_node_put() before error out
  intel_pstate: Do not clear utilization update hooks on policy changes
This commit is contained in:
Linus Torvalds 2016-07-01 15:28:22 -07:00
commit 81dbd6f59d
3 changed files with 11 additions and 5 deletions

View File

@ -79,15 +79,16 @@ static const struct of_device_id machines[] __initconst = {
static int __init cpufreq_dt_platdev_init(void)
{
struct device_node *np = of_find_node_by_path("/");
const struct of_device_id *match;
if (!np)
return -ENODEV;
if (!of_match_node(machines, np))
match = of_match_node(machines, np);
of_node_put(np);
if (!match)
return -ENODEV;
of_node_put(of_root);
return PTR_ERR_OR_ZERO(platform_device_register_simple("cpufreq-dt", -1,
NULL, 0));
}

View File

@ -2261,6 +2261,10 @@ int cpufreq_update_policy(unsigned int cpu)
* -> ask driver for current freq and notify governors about a change
*/
if (cpufreq_driver->get && !cpufreq_driver->setpolicy) {
if (cpufreq_suspended) {
ret = -EAGAIN;
goto unlock;
}
new_policy.cur = cpufreq_update_current_freq(policy);
if (WARN_ON(!new_policy.cur)) {
ret = -EIO;

View File

@ -1400,6 +1400,9 @@ static void intel_pstate_set_update_util_hook(unsigned int cpu_num)
{
struct cpudata *cpu = all_cpu_data[cpu_num];
if (cpu->update_util_set)
return;
/* Prevent intel_pstate_update_util() from using stale data. */
cpu->sample.time = 0;
cpufreq_add_update_util_hook(cpu_num, &cpu->update_util,
@ -1440,8 +1443,6 @@ static int intel_pstate_set_policy(struct cpufreq_policy *policy)
if (!policy->cpuinfo.max_freq)
return -ENODEV;
intel_pstate_clear_update_util_hook(policy->cpu);
pr_debug("set_policy cpuinfo.max %u policy->max %u\n",
policy->cpuinfo.max_freq, policy->max);