Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branches 'pm-domains' and 'pm-cpufreq'

* pm-domains:
PM / Domains: Fix bad of_node_put() in failure paths of genpd_dev_pm_attach()
PM / Domains: Validate cases of a non-bound driver in genpd governor

* pm-cpufreq:
cpufreq: use last policy after online for drivers with ->setpolicy

+12 -9
+1 -2
drivers/base/power/domain.c
··· 1775 1775 } 1776 1776 1777 1777 pd = of_genpd_get_from_provider(&pd_args); 1778 + of_node_put(pd_args.np); 1778 1779 if (IS_ERR(pd)) { 1779 1780 dev_dbg(dev, "%s() failed to find PM domain: %ld\n", 1780 1781 __func__, PTR_ERR(pd)); 1781 - of_node_put(dev->of_node); 1782 1782 return -EPROBE_DEFER; 1783 1783 } 1784 1784 ··· 1796 1796 if (ret < 0) { 1797 1797 dev_err(dev, "failed to add to PM domain %s: %d", 1798 1798 pd->name, ret); 1799 - of_node_put(dev->of_node); 1800 1799 goto out; 1801 1800 } 1802 1801
-3
drivers/base/power/domain_governor.c
··· 160 160 struct gpd_timing_data *td; 161 161 s64 constraint_ns; 162 162 163 - if (!pdd->dev->driver) 164 - continue; 165 - 166 163 /* 167 164 * Check if the device is allowed to be off long enough for the 168 165 * domain to turn off and on (that's how much time it will
+10 -4
drivers/cpufreq/cpufreq.c
··· 976 976 977 977 new_policy.governor = gov; 978 978 979 - /* Use the default policy if its valid. */ 980 - if (cpufreq_driver->setpolicy) 981 - cpufreq_parse_governor(gov->name, &new_policy.policy, NULL); 982 - 979 + /* Use the default policy if there is no last_policy. */ 980 + if (cpufreq_driver->setpolicy) { 981 + if (policy->last_policy) 982 + new_policy.policy = policy->last_policy; 983 + else 984 + cpufreq_parse_governor(gov->name, &new_policy.policy, 985 + NULL); 986 + } 983 987 /* set default policy */ 984 988 return cpufreq_set_policy(policy, &new_policy); 985 989 } ··· 1334 1330 if (has_target()) 1335 1331 strncpy(policy->last_governor, policy->governor->name, 1336 1332 CPUFREQ_NAME_LEN); 1333 + else 1334 + policy->last_policy = policy->policy; 1337 1335 } else if (cpu == policy->cpu) { 1338 1336 /* Nominate new CPU */ 1339 1337 policy->cpu = cpumask_any(policy->cpus);
+1
include/linux/cpufreq.h
··· 77 77 unsigned int suspend_freq; /* freq to set during suspend */ 78 78 79 79 unsigned int policy; /* see above */ 80 + unsigned int last_policy; /* policy before unplug */ 80 81 struct cpufreq_governor *governor; /* see below */ 81 82 void *governor_data; 82 83 bool governor_enabled; /* governor start/stop flag */