linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bernie Thompson <bhthompson@chromium.org>
To: linux-pm@vger.kernel.org
Cc: Pavel Machek <pavel@ucw.cz>, "Rafael J. Wysocki" <rjw@sisk.pl>,
	Len Brown <len.brown@intel.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-kernel@vger.kernel.org,
	Bernie Thompson <bhthompson@chromium.org>
Subject: [PATCH] PM / wakeup: Adjust messaging for wake events during suspend
Date: Fri, 31 May 2013 17:47:43 -0700	[thread overview]
Message-ID: <1370047663-432-1-git-send-email-bhthompson@chromium.org> (raw)

This adds in a new message to the wakeup code which adds an indication to
the log that suspend was cancelled due to a wake event occouring during
the suspend sequence. It also adjusts the message printed in suspend.c to
reflect the potential that a suspend was aborted, as opposed to a device
failing to suspend.

Without these message adjustments one can end up with a kernel log that says
that a device failed to suspend with no actual device suspend failures,
which can be confusing to the log examiner.

Signed-off-by: Bernie Thompson <bhthompson@chromium.org>
---
 drivers/base/power/wakeup.c | 4 +++-
 kernel/power/suspend.c      | 2 +-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/base/power/wakeup.c b/drivers/base/power/wakeup.c
index 79715e7..407a2ef 100644
--- a/drivers/base/power/wakeup.c
+++ b/drivers/base/power/wakeup.c
@@ -707,8 +707,10 @@ bool pm_wakeup_pending(void)
 	}
 	spin_unlock_irqrestore(&events_lock, flags);
 
-	if (ret)
+	if (ret) {
+		pr_info("PM: Wakeup pending, aborting suspend\n");
 		print_active_wakeup_sources();
+	}
 
 	return ret;
 }
diff --git a/kernel/power/suspend.c b/kernel/power/suspend.c
index bef86d1..ece0422 100644
--- a/kernel/power/suspend.c
+++ b/kernel/power/suspend.c
@@ -269,7 +269,7 @@ int suspend_devices_and_enter(suspend_state_t state)
 	suspend_test_start();
 	error = dpm_suspend_start(PMSG_SUSPEND);
 	if (error) {
-		printk(KERN_ERR "PM: Some devices failed to suspend\n");
+		pr_err("PM: Some devices failed to suspend, or early wake event detected\n");
 		goto Recover_platform;
 	}
 	suspend_test_finish("suspend devices");
-- 
1.8.2.1


             reply	other threads:[~2013-06-01  0:53 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-01  0:47 Bernie Thompson [this message]
2013-06-24 12:08 ` [PATCH] PM / wakeup: Adjust messaging for wake events during suspend Rafael J. Wysocki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1370047663-432-1-git-send-email-bhthompson@chromium.org \
    --to=bhthompson@chromium.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=len.brown@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=pavel@ucw.cz \
    --cc=rjw@sisk.pl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).