From patchwork Fri May 8 02:07:42 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ruchi Kandoi X-Patchwork-Id: 6362091 X-Patchwork-Delegate: rjw@sisk.pl Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id D9631BEEE1 for ; Fri, 8 May 2015 02:09:29 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0C90A203B1 for ; Fri, 8 May 2015 02:09:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 11554202F2 for ; Fri, 8 May 2015 02:09:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751612AbbEHCJY (ORCPT ); Thu, 7 May 2015 22:09:24 -0400 Received: from mail-ig0-f177.google.com ([209.85.213.177]:38759 "EHLO mail-ig0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750995AbbEHCJX (ORCPT ); Thu, 7 May 2015 22:09:23 -0400 Received: by igbhj9 with SMTP id hj9so10052676igb.1 for ; Thu, 07 May 2015 19:09:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=NgQfIX9zfS3Lw7FpO0BCf0bbt1DQxaFa2sVyLEp9gHI=; b=BhWvragDOwpv2XWSP6yTr4a4gqVMQfnB3OxFdnKBdnVW82T/T98ehD3QC3qSoaBGSX DfkEbBVyl4YvT1fGEl+1x+SXK6UFGAss3xAhhMwtut0DishBjzuH9dI4Q8qgZfXRsfVb HNhDs7gNRmBuXBnm9RUjud2dNaEA+pHI18CEcwABAQU2Q8FYRR6bDiOQMGjhNbo9MTbs YgZJsjNOCrGV5msXp03LzX65u94RmEIwaIlS8+CV+TtkVywxw9LgK04uOemKH+YTb4R8 9c1WQsT/+/OiPXO0dk8j/0uTJRUV8yiA1oBTkZUdd7IEe5U0HgKMIuCqN2k/8sPzPlyO zBIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=NgQfIX9zfS3Lw7FpO0BCf0bbt1DQxaFa2sVyLEp9gHI=; b=eGU28d3ljYERJXqyzb2HTnrkjO9E2CeaVXvGRvJouPkRwAhuIWt0Rx4pln/DjecWZC oLva5j4K3wEsAms/09T2ZZg34l3SK1vpXdhYMT/K13BtU7vuKKreTfIBHZTXPxDIptNj G4X/TY6894cG2Pj1ri/6uT5YdUqmAq7Xo1OytRvavVtnq1Hg92NMJvjqeVYLnfN58gWm ednHVpxCY6sYqS49I/Sqs5jLKMcHMWz/8/7p/XyoU9Rf5GDaY1rhkYq08LmTKpicianh I8xufbeL6Zany/UXeJdr6qYOEq8K80kEgmjwW1ga3jJOKYddYN5l3OZo1ipqNfohhMDu dPFA== X-Gm-Message-State: ALoCoQnz5auaOwWdjVDaOig63Y38jiRD1SGpbmatpc9LxfUn5qN1W+XuGAXcwsJEWWYeFDE4Ae8v X-Received: by 10.107.133.132 with SMTP id p4mr1230466ioi.40.1431050962814; Thu, 07 May 2015 19:09:22 -0700 (PDT) Received: from kandoiruchi.mtv.corp.google.com ([172.22.121.97]) by mx.google.com with ESMTPSA id i185sm2560838ioi.24.2015.05.07.19.09.21 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 07 May 2015 19:09:22 -0700 (PDT) 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-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,RCVD_IN_DNSWL_HI,T_DKIM_INVALID,T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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(); }