diff options
| author | Paul Mundt <lethal@linux-sh.org> | 2012-02-24 13:23:23 +0900 |
|---|---|---|
| committer | Paul Mundt <lethal@linux-sh.org> | 2012-02-24 13:23:23 +0900 |
| commit | 35eb304b5cd7b49d581bda79218b8134f3b689ea (patch) | |
| tree | 3d75d9ada70814161d035b2f9166fee05d257dfb /kernel/power/user.c | |
| parent | ca0cc30109241f280eb871794620d7cf198bb582 (diff) | |
| parent | bb4c7e9a9908548b458f34afb2fee74dc0d49f90 (diff) | |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux into rmobile-fixes-for-linus
Diffstat (limited to 'kernel/power/user.c')
| -rw-r--r-- | kernel/power/user.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/kernel/power/user.c b/kernel/power/user.c index 6b1ab7a8852..3e100075b13 100644 --- a/kernel/power/user.c +++ b/kernel/power/user.c @@ -249,13 +249,15 @@ static long snapshot_ioctl(struct file *filp, unsigned int cmd, } pm_restore_gfp_mask(); error = hibernation_snapshot(data->platform_support); - if (!error) { + if (error) { + thaw_kernel_threads(); + } else { error = put_user(in_suspend, (int __user *)arg); if (!error && !freezer_test_done) data->ready = 1; if (freezer_test_done) { freezer_test_done = false; - thaw_processes(); + thaw_kernel_threads(); } } break; @@ -274,6 +276,15 @@ static long snapshot_ioctl(struct file *filp, unsigned int cmd, swsusp_free(); memset(&data->handle, 0, sizeof(struct snapshot_handle)); data->ready = 0; + /* + * It is necessary to thaw kernel threads here, because + * SNAPSHOT_CREATE_IMAGE may be invoked directly after + * SNAPSHOT_FREE. In that case, if kernel threads were not + * thawed, the preallocation of memory carried out by + * hibernation_snapshot() might run into problems (i.e. it + * might fail or even deadlock). + */ + thaw_kernel_threads(); break; case SNAPSHOT_PREF_IMAGE_SIZE: |
