diff mbox

suspend: Return error when pending wakeup source is found.

Message ID 1431050862-26473-1-git-send-email-kandoiruchi@google.com (mailing list archive)
State Accepted, archived
Delegated to: Rafael Wysocki
Headers show

Commit Message

Ruchi Kandoi May 8, 2015, 2:07 a.m. UTC
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.

Signed-off-by: Ruchi Kandoi <kandoiruchi@google.com>
---
 kernel/power/suspend.c | 2 ++
 1 file changed, 2 insertions(+)
diff mbox

Patch

diff --git a/kernel/power/suspend.c b/kernel/power/suspend.c
index 8d7a1ef..343b4e4 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();
 	}