[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <201012030123.43786.rjw@sisk.pl>
Date: Fri, 3 Dec 2010 01:23:43 +0100
From: "Rafael J. Wysocki" <rjw@...k.pl>
To: "Linux-pm mailing list" <linux-pm@...ts.linux-foundation.org>
Cc: LKML <linux-kernel@...r.kernel.org>,
Alan Stern <stern@...land.harvard.edu>
Subject: [PATCH 3/3] PM: Use pm_wakeup_pending() in device_suspend()
From: Rafael J. Wysocki <rjw@...k.pl>
Before starting to suspend a device in device_suspend() check if
there's a request to abort the power transition and return -EBUSY
in that case.
Signed-off-by: Rafael J. Wysocki <rjw@...k.pl>
---
drivers/base/power/main.c | 5 +++++
1 file changed, 5 insertions(+)
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
@@ -935,6 +935,11 @@ static void async_suspend(void *data, as
static int device_suspend(struct device *dev)
{
+ if (pm_wakeup_pending()) {
+ async_error = -EBUSY;
+ return async_error;
+ }
+
INIT_COMPLETION(dev->power.completion);
if (pm_async_enabled && dev->power.async_suspend) {
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists