diff options
author | Ruchi Kandoi <kandoiruchi@google.com> | 2015-05-08 04:07:42 +0200 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2015-05-19 02:26:56 +0200 |
commit | 671767360db8fdd1f082d15fb4b0107c1bb94a0b (patch) | |
tree | b6034c7606da0728504e449353f46ec74bdfac54 /kernel/power | |
parent | PM / tick: Add tracepoints for suspend-to-idle diagnostics (diff) | |
download | linux-671767360db8fdd1f082d15fb4b0107c1bb94a0b.tar.xz linux-671767360db8fdd1f082d15fb4b0107c1bb94a0b.zip |
PM / sleep: Return -EBUSY from suspend_enter() on wakeup detection
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 <kandoiruchi@google.com>
[ rjw: Subject and changelog ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'kernel/power')
-rw-r--r-- | kernel/power/suspend.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/kernel/power/suspend.c b/kernel/power/suspend.c index 274371a71ed0..53266b729fd9 100644 --- a/kernel/power/suspend.c +++ b/kernel/power/suspend.c @@ -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(); } |