Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 47422
b: refs/heads/master
c: e3c7db6
h: refs/heads/master
v: v3
  • Loading branch information
Rafael J. Wysocki authored and Linus Torvalds committed Feb 11, 2007
1 parent 0d4f6ed commit 73e5ce8
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 16 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: c1725f2af89f1eda3cb9007290971b55084569a4
refs/heads/master: e3c7db621bed4afb8e231cb005057f2feb5db557
34 changes: 19 additions & 15 deletions trunk/kernel/power/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ void pm_set_ops(struct pm_ops * ops)
mutex_unlock(&pm_mutex);
}

static inline void pm_finish(suspend_state_t state)
{
if (pm_ops->finish)
pm_ops->finish(state);
}

/**
* suspend_prepare - Do prep work before entering low-power state.
Expand All @@ -64,10 +69,6 @@ static int suspend_prepare(suspend_state_t state)

pm_prepare_console();

error = disable_nonboot_cpus();
if (error)
goto Enable_cpu;

if (freeze_processes()) {
error = -EAGAIN;
goto Thaw;
Expand All @@ -90,18 +91,22 @@ static int suspend_prepare(suspend_state_t state)
}

suspend_console();
if ((error = device_suspend(PMSG_SUSPEND))) {
error = device_suspend(PMSG_SUSPEND);
if (error) {
printk(KERN_ERR "Some devices failed to suspend\n");
goto Finish;
goto Resume_devices;
}
return 0;
Finish:
if (pm_ops->finish)
pm_ops->finish(state);
error = disable_nonboot_cpus();
if (!error)
return 0;

enable_nonboot_cpus();
Resume_devices:
pm_finish(state);
device_resume();
resume_console();
Thaw:
thaw_processes();
Enable_cpu:
enable_nonboot_cpus();
pm_restore_console();
return error;
}
Expand Down Expand Up @@ -136,12 +141,11 @@ int suspend_enter(suspend_state_t state)

static void suspend_finish(suspend_state_t state)
{
enable_nonboot_cpus();
pm_finish(state);
device_resume();
resume_console();
thaw_processes();
enable_nonboot_cpus();
if (pm_ops && pm_ops->finish)
pm_ops->finish(state);
pm_restore_console();
}

Expand Down

0 comments on commit 73e5ce8

Please sign in to comment.