Skip to content

Commit cd16f3d

Browse files
committed
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
3 parents bc33b0c + c25badc + 6f75c3f commit cd16f3d

File tree

3 files changed

+9
-10
lines changed

3 files changed

+9
-10
lines changed

drivers/base/power/main.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1027,6 +1027,8 @@ static int __device_suspend_noirq(struct device *dev, pm_message_t state, bool a
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
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
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
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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,8 +203,10 @@ static int __init test_suspend(void)
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

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ int cmd_freq_set(int argc, char **argv)
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)
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);

0 commit comments

Comments
 (0)