suspend: Return error when pending wakeup source is found.
authorRuchi Kandoi <kandoiruchi@google.com>
Thu, 7 May 2015 17:18:55 +0000 (10:18 -0700)
committerRuchi Kandoi <kandoiruchi@google.com>
Mon, 18 May 2015 16:57:19 +0000 (16:57 +0000)
If a wakeup source is found to be pending in the last stage of suspend
after syscore suspend then the device doesn't suspend but the error is
not propogated which causes an error in the accounting for the number
of suspend aborts and successful suspends.

Change-Id: Ib63b4ead755127eaf03e3b303aab3c782ad02ed1
Signed-off-by: Ruchi Kandoi <kandoiruchi@google.com>
kernel/power/suspend.c

index 7c53fea31cba66727d0f99514aa9717e6af68392..221037af99af498ab65239ee52dba210e8301814 100644 (file)
@@ -232,10 +232,11 @@ static int suspend_enter(suspend_state_t state, bool *wakeup)
                if (!(suspend_test(TEST_CORE) || *wakeup)) {
                        error = suspend_ops->enter(state);
                        events_check_enabled = false;
-               } else {
+               } else if (*wakeup) {
                        pm_get_active_wakeup_sources(suspend_abort,
                                MAX_SUSPEND_ABORT_LEN);
                        log_suspend_abort_reason(suspend_abort);
+                       error = -EBUSY;
                }
                syscore_resume();
        }