Skip to content

Commit

Permalink
PM / sleep: Return -EBUSY from suspend_enter() on wakeup detection
Browse files Browse the repository at this point in the history
If a wakeup source is found to be pending in the last stage of
suspend after syscore suspend, then the machine won't suspend, but
suspend_enter() will return 0.  That is confusing, as wakeup detection
elsewhere causes -EBUSY to be returned from suspend_enter().

To avoid the confusion, make suspend_enter() return -EBUSY in that
case too.

Signed-off-by: Ruchi Kandoi <[email protected]>
[ rjw: Subject and changelog ]
Signed-off-by: Rafael J. Wysocki <[email protected]>
  • Loading branch information
Ruchi Kandoi authored and rafaeljw committed May 19, 2015
1 parent 75e0678 commit 6717673
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions kernel/power/suspend.c
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,8 @@ static int suspend_enter(suspend_state_t state, bool *wakeup)
trace_suspend_resume(TPS("machine_suspend"),
state, false);
events_check_enabled = false;
} else if (*wakeup) {
error = -EBUSY;
}
syscore_resume();
}
Expand Down

0 comments on commit 6717673

Please sign in to comment.