Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 202548
b: refs/heads/master
c: ce44101
h: refs/heads/master
v: v3
  • Loading branch information
Rafael J. Wysocki committed Jul 19, 2010
1 parent ae2393f commit 923ecef
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 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: d074ee023fa3a4681b64223c5e636102c39628c4
refs/heads/master: ce4410116c5debfb0e049f5db4b5cd6211e05b80
10 changes: 6 additions & 4 deletions trunk/include/linux/suspend.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,15 @@ typedef int __bitwise suspend_state_t;
* before device drivers' late suspend callbacks are executed. It returns
* 0 on success or a negative error code otherwise, in which case the
* system cannot enter the desired sleep state (@prepare_late(), @enter(),
* @wake(), and @finish() will not be called in that case).
* and @wake() will not be called in that case).
*
* @prepare_late: Finish preparing the platform for entering the system sleep
* state indicated by @begin().
* @prepare_late is called before disabling nonboot CPUs and after
* device drivers' late suspend callbacks have been executed. It returns
* 0 on success or a negative error code otherwise, in which case the
* system cannot enter the desired sleep state (@enter() and @wake()).
* system cannot enter the desired sleep state (@enter() will not be
* executed).
*
* @enter: Enter the system sleep state indicated by @begin() or represented by
* the argument if @begin() is not implemented.
Expand All @@ -81,14 +82,15 @@ typedef int __bitwise suspend_state_t;
* resume callbacks are executed.
* This callback is optional, but should be implemented by the platforms
* that implement @prepare_late(). If implemented, it is always called
* after @enter(), even if @enter() fails.
* after @prepare_late and @enter(), even if one of them fails.
*
* @finish: Finish wake-up of the platform.
* @finish is called right prior to calling device drivers' regular suspend
* callbacks.
* This callback is optional, but should be implemented by the platforms
* that implement @prepare(). If implemented, it is always called after
* @enter() and @wake(), if implemented, even if any of them fails.
* @enter() and @wake(), even if any of them fails. It is executed after
* a failing @prepare.
*
* @end: Called by the PM core right after resuming devices, to indicate to
* the platform that the system has returned to the working state or
Expand Down
9 changes: 4 additions & 5 deletions trunk/kernel/power/suspend.c
Original file line number Diff line number Diff line change
Expand Up @@ -136,19 +136,19 @@ static int suspend_enter(suspend_state_t state)
if (suspend_ops->prepare) {
error = suspend_ops->prepare();
if (error)
return error;
goto Platform_finish;
}

error = dpm_suspend_noirq(PMSG_SUSPEND);
if (error) {
printk(KERN_ERR "PM: Some devices failed to power down\n");
goto Platfrom_finish;
goto Platform_finish;
}

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

if (suspend_test(TEST_PLATFORM))
Expand Down Expand Up @@ -180,10 +180,9 @@ static int suspend_enter(suspend_state_t state)
if (suspend_ops->wake)
suspend_ops->wake();

Power_up_devices:
dpm_resume_noirq(PMSG_RESUME);

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

Expand Down

0 comments on commit 923ecef

Please sign in to comment.