mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-29 13:53:33 +00:00
[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>
This commit is contained in:
parent
8215534ce7
commit
42b16c051c
1 changed files with 12 additions and 1 deletions
|
@ -114,8 +114,19 @@ int device_suspend(pm_message_t state)
|
||||||
put_device(dev);
|
put_device(dev);
|
||||||
}
|
}
|
||||||
up(&dpm_list_sem);
|
up(&dpm_list_sem);
|
||||||
if (error)
|
if (error) {
|
||||||
|
/* we failed... before resuming, bring back devices from
|
||||||
|
* dpm_off_irq list back to main dpm_off list, we do want
|
||||||
|
* to call resume() on them, in case they partially suspended
|
||||||
|
* despite returning -EAGAIN
|
||||||
|
*/
|
||||||
|
while (!list_empty(&dpm_off_irq)) {
|
||||||
|
struct list_head * entry = dpm_off_irq.next;
|
||||||
|
list_del(entry);
|
||||||
|
list_add(entry, &dpm_off);
|
||||||
|
}
|
||||||
dpm_resume();
|
dpm_resume();
|
||||||
|
}
|
||||||
up(&dpm_sem);
|
up(&dpm_sem);
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue