diff options
Diffstat (limited to 'kernel/power/user.c')
-rw-r--r-- | kernel/power/user.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/kernel/power/user.c b/kernel/power/user.c index 6b1ab7a88522..33c4329205af 100644 --- a/kernel/power/user.c +++ b/kernel/power/user.c | |||
@@ -251,12 +251,8 @@ static long snapshot_ioctl(struct file *filp, unsigned int cmd, | |||
251 | error = hibernation_snapshot(data->platform_support); | 251 | error = hibernation_snapshot(data->platform_support); |
252 | if (!error) { | 252 | if (!error) { |
253 | error = put_user(in_suspend, (int __user *)arg); | 253 | error = put_user(in_suspend, (int __user *)arg); |
254 | if (!error && !freezer_test_done) | 254 | data->ready = !freezer_test_done && !error; |
255 | data->ready = 1; | 255 | freezer_test_done = false; |
256 | if (freezer_test_done) { | ||
257 | freezer_test_done = false; | ||
258 | thaw_processes(); | ||
259 | } | ||
260 | } | 256 | } |
261 | break; | 257 | break; |
262 | 258 | ||
@@ -274,6 +270,15 @@ static long snapshot_ioctl(struct file *filp, unsigned int cmd, | |||
274 | swsusp_free(); | 270 | swsusp_free(); |
275 | memset(&data->handle, 0, sizeof(struct snapshot_handle)); | 271 | memset(&data->handle, 0, sizeof(struct snapshot_handle)); |
276 | data->ready = 0; | 272 | data->ready = 0; |
273 | /* | ||
274 | * It is necessary to thaw kernel threads here, because | ||
275 | * SNAPSHOT_CREATE_IMAGE may be invoked directly after | ||
276 | * SNAPSHOT_FREE. In that case, if kernel threads were not | ||
277 | * thawed, the preallocation of memory carried out by | ||
278 | * hibernation_snapshot() might run into problems (i.e. it | ||
279 | * might fail or even deadlock). | ||
280 | */ | ||
281 | thaw_kernel_threads(); | ||
277 | break; | 282 | break; |
278 | 283 | ||
279 | case SNAPSHOT_PREF_IMAGE_SIZE: | 284 | case SNAPSHOT_PREF_IMAGE_SIZE: |