diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2005-05-31 03:08:49 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2005-06-20 18:15:37 -0400 |
commit | 42b16c051c3f462095fb8c9bad1bc05b34518cb9 (patch) | |
tree | 3178bf5b2e3b516b6aea270c757adf728db83836 /drivers | |
parent | 8215534ce7d073423bfa9c17405c43ab7636ca03 (diff) |
[PATCH] Driver core: Don't "lose" devices on suspend on failure
I think we need this patch or we might "lose" devices to the dpm_irq_off
list if a failure occurs during the suspend process.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/base/power/suspend.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/drivers/base/power/suspend.c b/drivers/base/power/suspend.c index 807e13fb205b..2ccee3763acf 100644 --- a/drivers/base/power/suspend.c +++ b/drivers/base/power/suspend.c | |||
@@ -114,8 +114,19 @@ int device_suspend(pm_message_t state) | |||
114 | put_device(dev); | 114 | put_device(dev); |
115 | } | 115 | } |
116 | up(&dpm_list_sem); | 116 | up(&dpm_list_sem); |
117 | if (error) | 117 | if (error) { |
118 | /* we failed... before resuming, bring back devices from | ||
119 | * dpm_off_irq list back to main dpm_off list, we do want | ||
120 | * to call resume() on them, in case they partially suspended | ||
121 | * despite returning -EAGAIN | ||
122 | */ | ||
123 | while (!list_empty(&dpm_off_irq)) { | ||
124 | struct list_head * entry = dpm_off_irq.next; | ||
125 | list_del(entry); | ||
126 | list_add(entry, &dpm_off); | ||
127 | } | ||
118 | dpm_resume(); | 128 | dpm_resume(); |
129 | } | ||
119 | up(&dpm_sem); | 130 | up(&dpm_sem); |
120 | return error; | 131 | return error; |
121 | } | 132 | } |