Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 139001
b: refs/heads/master
c: 900af0d
h: refs/heads/master
i:
  138999: eae1bed
v: v3
  • Loading branch information
Rafael J. Wysocki committed Mar 30, 2009
1 parent 2e441ff commit b67ce37
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 17 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2ed8d2b3a81bdbb0418301628ccdb008ac9f40b7
refs/heads/master: 900af0d973856d6feb6fc088c2d0d3fde57707d3
38 changes: 22 additions & 16 deletions trunk/kernel/power/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,19 @@ static int suspend_enter(suspend_state_t state)
goto Done;
}

if (suspend_ops->prepare) {
error = suspend_ops->prepare();
if (error)
goto Power_up_devices;
}

if (suspend_test(TEST_PLATFORM))
goto Platfrom_finish;

error = disable_nonboot_cpus();
if (error || suspend_test(TEST_CPUS))
goto Enable_cpus;

arch_suspend_disable_irqs();
BUG_ON(!irqs_disabled());

Expand All @@ -310,6 +323,14 @@ static int suspend_enter(suspend_state_t state)
arch_suspend_enable_irqs();
BUG_ON(irqs_disabled());

Enable_cpus:
enable_nonboot_cpus();

Platfrom_finish:
if (suspend_ops->finish)
suspend_ops->finish();

Power_up_devices:
device_power_up(PMSG_RESUME);

Done:
Expand Down Expand Up @@ -346,23 +367,8 @@ int suspend_devices_and_enter(suspend_state_t state)
if (suspend_test(TEST_DEVICES))
goto Recover_platform;

if (suspend_ops->prepare) {
error = suspend_ops->prepare();
if (error)
goto Resume_devices;
}

if (suspend_test(TEST_PLATFORM))
goto Finish;
suspend_enter(state);

error = disable_nonboot_cpus();
if (!error && !suspend_test(TEST_CPUS))
suspend_enter(state);

enable_nonboot_cpus();
Finish:
if (suspend_ops->finish)
suspend_ops->finish();
Resume_devices:
suspend_test_start();
device_resume(PMSG_RESUME);
Expand Down

0 comments on commit b67ce37

Please sign in to comment.