Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751758AbbEHCJ0 (ORCPT ); Thu, 7 May 2015 22:09:26 -0400 Received: from mail-ie0-f172.google.com ([209.85.223.172]:33002 "EHLO mail-ie0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751384AbbEHCJX (ORCPT ); Thu, 7 May 2015 22:09:23 -0400 From: Ruchi Kandoi To: "Rafael J. Wysocki" , Pavel Machek , Len Brown Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, kandoiruchi@google.com Subject: [PATCH] suspend: Return error when pending wakeup source is found. Date: Thu, 7 May 2015 19:07:42 -0700 Message-Id: <1431050862-26473-1-git-send-email-kandoiruchi@google.com> X-Mailer: git-send-email 2.2.0.rc0.207.ga3a616c Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1060 Lines: 31 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 --- kernel/power/suspend.c | 2 ++ 1 file changed, 2 insertions(+) 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(); } -- 2.2.0.rc0.207.ga3a616c -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/