summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2011-06-18 22:42:09 +0200
committerGreg Kroah-Hartman <gregkh@suse.de>2011-07-08 23:15:26 -0700
commit81fdcbdd2dc212eb5d89b5fa4e1f69b48843d037 (patch)
treeca8a768d40c03a3254255e75401e3501c006d4a9 /include
parent1823968020d2e0e173a001e38ed648595c817fe1 (diff)
PM: Fix async resume following suspend failure
commit 6d0e0e84f66d32c33511984dd3badd32364b863c upstream. The PM core doesn't handle suspend failures correctly when it comes to asynchronously suspended devices. These devices are moved onto the dpm_suspended_list as soon as the corresponding async thread is started up, and they remain on the list even if they fail to suspend or the sleep transition is cancelled before they get suspended. As a result, when the PM core unwinds the transition, it tries to resume the devices even though they were never suspended. This patch (as1474) fixes the problem by adding a new "is_suspended" flag to dev_pm_info. Devices are resumed only if the flag is set. [rjw: * Moved the dev->power.is_suspended check into device_resume(), because we need to complete dev->power.completion and clear dev->power.is_prepared too for devices whose dev->power.is_suspended flags are unset. * Fixed __device_suspend() to avoid setting dev->power.is_suspended if async_error is different from zero.] Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'include')
-rw-r--r--include/linux/pm.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/pm.h b/include/linux/pm.h
index 50ee75fa7fd..fffb12f21aa 100644
--- a/include/linux/pm.h
+++ b/include/linux/pm.h
@@ -426,6 +426,7 @@ struct dev_pm_info {
unsigned int can_wakeup:1;
unsigned int async_suspend:1;
bool is_prepared:1; /* Owned by the PM core */
+ bool is_suspended:1; /* Ditto */
spinlock_t lock;
#ifdef CONFIG_PM_SLEEP
struct list_head entry;