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