From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: "Linux-pm mailing list" <linux-pm@lists.linux-foundation.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
Alan Stern <stern@rowland.harvard.edu>
Subject: [PATCH 1/3] PM: Changes related to wakeup events
Date: Fri, 3 Dec 2010 01:20:36 +0100 [thread overview]
Message-ID: <201012030120.36455.rjw@sisk.pl> (raw)
In-Reply-To: <201012030118.30603.rjw@sisk.pl>
From: Rafael J. Wysocki <rjw@sisk.pl>
Currently dpm_prepare() returns error code if it finds that a device
being suspended has a pending runtime resume request. However, it
should not do that if the checking for wakeup events is not enabled.
On the other hand, if the checking for wakeup events is enabled, it
can return error when a wakeup event is detected, regardless of its
source.
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
---
drivers/base/power/main.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
Index: linux-2.6/drivers/base/power/main.c
===================================================================
--- linux-2.6.orig/drivers/base/power/main.c
+++ linux-2.6/drivers/base/power/main.c
@@ -26,6 +26,7 @@
#include <linux/interrupt.h>
#include <linux/sched.h>
#include <linux/async.h>
+#include <linux/suspend.h>
#include "../base.h"
#include "power.h"
@@ -1052,8 +1053,10 @@ static int dpm_prepare(pm_message_t stat
mutex_unlock(&dpm_list_mtx);
pm_runtime_get_noresume(dev);
- if (pm_runtime_barrier(dev) && device_may_wakeup(dev)) {
- /* Wake-up requested during system sleep transition. */
+ if (pm_runtime_barrier(dev) && device_may_wakeup(dev))
+ pm_wakeup_event(dev, 0);
+
+ if (!pm_check_wakeup_events()) {
pm_runtime_put_sync(dev);
error = -EBUSY;
} else {
@@ -1068,8 +1071,8 @@ static int dpm_prepare(pm_message_t stat
error = 0;
continue;
}
- printk(KERN_ERR "PM: Failed to prepare device %s "
- "for power transition: error %d\n",
+ printk(KERN_INFO "PM: Device %s not prepared "
+ "for power transition: code %d\n",
kobject_name(&dev->kobj), error);
put_device(dev);
break;
next prev parent reply other threads:[~2010-12-03 0:29 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-03 0:18 [PATCH 0/3] " Rafael J. Wysocki
2010-12-03 0:20 ` Rafael J. Wysocki [this message]
2010-12-03 0:22 ` [PATCH 2/3] PM / Wakeup: Replace pm_check_wakeup_events() with pm_wakeup_pending() Rafael J. Wysocki
2010-12-03 0:23 ` [PATCH 3/3] PM: Use pm_wakeup_pending() in device_suspend() Rafael J. Wysocki
2010-12-03 15:26 ` Alan Stern
2010-12-03 21:54 ` Rafael J. Wysocki
2010-12-03 22:04 ` Alan Stern
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=201012030120.36455.rjw@sisk.pl \
--to=rjw@sisk.pl \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@lists.linux-foundation.org \
--cc=stern@rowland.harvard.edu \
/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
all inboxes | Powered by JetHome®