From: Ruchi Kandoi Date: Thu, 7 May 2015 17:18:55 +0000 (-0700) Subject: suspend: Return error when pending wakeup source is found. X-Git-Tag: firefly_0821_release~4090^2~7 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=6e9c6582376ac3c430bf7c89647313b2e685a597;p=firefly-linux-kernel-4.4.55.git suspend: Return error when pending wakeup source is found. 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 --- diff --git a/kernel/power/suspend.c b/kernel/power/suspend.c index 7c53fea31cba..221037af99af 100644 --- a/kernel/power/suspend.c +++ b/kernel/power/suspend.c @@ -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(); }