History

Merge branches 'pm-tools-fixes' and 'pm-sleep-fixes'

* pm-tools-fixes: cpupower: Correct return type of cpu_power_is_cpu_online() in cpufreq-set * pm-sleep-fixes: PM / sleep: don't suspend parent when async child suspend_{noirq, late} fails PM / sleep: fix device reference leak in test_suspend

Rafael J. Wysocki committed 10 years ago

Commit cd16f3d3 parents bc33b0c c25badc 6f75c3f3 files · +9 −10Browse files

Unified · Split

3 files
  1. drivers/base/power/main.c +4 −4
  2. kernel/power/suspend_test.c +3 −1
  3. tools/power/cpupower/utils/cpufreq-set.c +2 −5
drivers/base/power/main.c+4−4
@@ -1027,6 +1027,8 @@ static int __device_suspend_noirq(struct device *dev, pm_message_t state, bool a · 1026 unmodified lines
10271027 TRACE_DEVICE(dev);
10281028 TRACE_SUSPEND(0);
10291029
1030+ dpm_wait_for_children(dev, async);
1031+
10301032 if (async_error)
10311033 goto Complete;
10321034
@@ -1038,8 +1040,6 @@ static int __device_suspend_noirq(struct device *dev, pm_message_t state, bool a · 5 unmodified lines
10381040 if (dev->power.syscore || dev->power.direct_complete)
10391041 goto Complete;
10401042
1041− dpm_wait_for_children(dev, async);
1042−
10431043 if (dev->pm_domain) {
10441044 info = "noirq power domain ";
10451045 callback = pm_noirq_op(&dev->pm_domain->ops, state);
@@ -1174,6 +1174,8 @@ static int __device_suspend_late(struct device *dev, pm_message_t state, bool as · 128 unmodified lines
11741174
11751175 __pm_runtime_disable(dev, false);
11761176
1177+ dpm_wait_for_children(dev, async);
1178+
11771179 if (async_error)
11781180 goto Complete;
11791181
@@ -1185,8 +1187,6 @@ static int __device_suspend_late(struct device *dev, pm_message_t state, bool as · 5 unmodified lines
11851187 if (dev->power.syscore || dev->power.direct_complete)
11861188 goto Complete;
11871189
1188− dpm_wait_for_children(dev, async);
1189−
11901190 if (dev->pm_domain) {
11911191 info = "late power domain ";
11921192 callback = pm_late_early_op(&dev->pm_domain->ops, state);
kernel/power/suspend_test.c+3−1
@@ -203,8 +203,10 @@ static int __init test_suspend(void) · 202 unmodified lines
203203
204204 /* RTCs have initialized by now too ... can we use one? */
205205 dev = class_find_device(rtc_class, NULL, NULL, has_wakealarm);
206− if (dev)
206+ if (dev) {
207207 rtc = rtc_class_open(dev_name(dev));
208+ put_device(dev);
209+ }
208210 if (!rtc) {
209211 printk(warn_no_rtc);
210212 return 0;
tools/power/cpupower/utils/cpufreq-set.c+2−5
@@ -296,7 +296,7 @@ int cmd_freq_set(int argc, char **argv) · 295 unmodified lines
296296 struct cpufreq_affected_cpus *cpus;
297297
298298 if (!bitmask_isbitset(cpus_chosen, cpu) ||
299− cpupower_is_cpu_online(cpu))
299+ cpupower_is_cpu_online(cpu) != 1)
300300 continue;
301301
302302 cpus = cpufreq_get_related_cpus(cpu);
@@ -316,10 +316,7 @@ int cmd_freq_set(int argc, char **argv) · 13 unmodified lines
316316 cpu <= bitmask_last(cpus_chosen); cpu++) {
317317
318318 if (!bitmask_isbitset(cpus_chosen, cpu) ||
319− cpupower_is_cpu_online(cpu))
320− continue;
321−
322− if (cpupower_is_cpu_online(cpu) != 1)
319+ cpupower_is_cpu_online(cpu) != 1)
323320 continue;
324321
325322 printf(_("Setting cpu: %d\n"), cpu);