History

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

Rafael J. Wysocki committed 10 years ago

Commit d441fe23 parents 3e5050e 265e2cf 69030dd4 files · +12 −9Browse files

Unified · Split

4 files
  1. drivers/base/power/domain.c +1 −2
  2. drivers/base/power/domain_governor.c +0 −3
  3. drivers/cpufreq/cpufreq.c +10 −4
  4. include/linux/cpufreq.h +1 −0
drivers/base/power/domain.c+1−2
@@ -1775,10 +1775,10 @@ int genpd_dev_pm_attach(struct device *dev) · 1774 unmodified lines
17751775 }
17761776
17771777 pd = of_genpd_get_from_provider(&pd_args);
1778+ of_node_put(pd_args.np);
17781779 if (IS_ERR(pd)) {
17791780 dev_dbg(dev, "%s() failed to find PM domain: %ld\n",
17801781 __func__, PTR_ERR(pd));
1781− of_node_put(dev->of_node);
17821782 return -EPROBE_DEFER;
17831783 }
17841784
@@ -1796,7 +1796,6 @@ int genpd_dev_pm_attach(struct device *dev) · 11 unmodified lines
17961796 if (ret < 0) {
17971797 dev_err(dev, "failed to add to PM domain %s: %d",
17981798 pd->name, ret);
1799− of_node_put(dev->of_node);
18001799 goto out;
18011800 }
18021801
drivers/base/power/domain_governor.c+0−3
@@ -160,9 +160,6 @@ static bool default_power_down_ok(struct dev_pm_domain *pd) · 159 unmodified lines
160160 struct gpd_timing_data *td;
161161 s64 constraint_ns;
162162
163− if (!pdd->dev->driver)
164− continue;
165−
166163 /*
167164 * Check if the device is allowed to be off long enough for the
168165 * domain to turn off and on (that's how much time it will
drivers/cpufreq/cpufreq.c+10−4
@@ -976,10 +976,14 @@ static int cpufreq_init_policy(struct cpufreq_policy *policy) · 975 unmodified lines
976976
977977 new_policy.governor = gov;
978978
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+ }
983987 /* set default policy */
984988 return cpufreq_set_policy(policy, &new_policy);
985989 }
@@ -1330,6 +1334,8 @@ static void cpufreq_offline_prepare(unsigned int cpu) · 344 unmodified lines
13301334 if (has_target())
13311335 strncpy(policy->last_governor, policy->governor->name,
13321336 CPUFREQ_NAME_LEN);
1337+ else
1338+ policy->last_policy = policy->policy;
13331339 } else if (cpu == policy->cpu) {
13341340 /* Nominate new CPU */
13351341 policy->cpu = cpumask_any(policy->cpus);
include/linux/cpufreq.h+1−0
@@ -77,6 +77,7 @@ struct cpufreq_policy { · 76 unmodified lines
7777 unsigned int suspend_freq; /* freq to set during suspend */
7878
7979 unsigned int policy; /* see above */
80+ unsigned int last_policy; /* policy before unplug */
8081 struct cpufreq_governor *governor; /* see below */
8182 void *governor_data;
8283 bool governor_enabled; /* governor start/stop flag */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t