diff options
author | Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> | 2011-12-20 17:01:18 -0500 |
---|---|---|
committer | Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> | 2011-12-20 17:01:18 -0500 |
commit | cb85f123cd2393581bcffad335bfc6bcdd58569c (patch) | |
tree | 7b0de48b2a13ca96251c02245ab906f7efa3ac18 /kernel/power/hibernate.c | |
parent | b79d2ff98caee60c07a7598aba3b26acd1655a99 (diff) | |
parent | caca6a03d365883564885f2c1da3e88dcf65d139 (diff) |
Merge commit 'v3.2-rc3' into stable/for-linus-3.3
* commit 'v3.2-rc3': (412 commits)
Linux 3.2-rc3
virtio-pci: make reset operation safer
virtio-mmio: Correct the name of the guest features selector
virtio: add HAS_IOMEM dependency to MMIO platform bus driver
eCryptfs: Extend array bounds for all filename chars
eCryptfs: Flush file in vma close
eCryptfs: Prevent file create race condition
regulator: TPS65910: Fix VDD1/2 voltage selector count
i2c: Make i2cdev_notifier_call static
i2c: Delete ANY_I2C_BUS
i2c: Fix device name for 10-bit slave address
i2c-algo-bit: Generate correct i2c address sequence for 10-bit target
drm: integer overflow in drm_mode_dirtyfb_ioctl()
Revert "of/irq: of_irq_find_parent: check for parent equal to child"
drivers/gpu/vga/vgaarb.c: add missing kfree
drm/radeon/kms/atom: unify i2c gpio table handling
drm/radeon/kms: fix up gpio i2c mask bits for r4xx for real
ttm: Don't return the bo reserved on error path
mount_subtree() pointless use-after-free
iio: fix a leak due to improper use of anon_inode_getfd()
...
Diffstat (limited to 'kernel/power/hibernate.c')
-rw-r--r-- | kernel/power/hibernate.c | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c index b4511b6d3ef9..196c01268ebd 100644 --- a/kernel/power/hibernate.c +++ b/kernel/power/hibernate.c | |||
@@ -55,6 +55,8 @@ enum { | |||
55 | 55 | ||
56 | static int hibernation_mode = HIBERNATION_SHUTDOWN; | 56 | static int hibernation_mode = HIBERNATION_SHUTDOWN; |
57 | 57 | ||
58 | static bool freezer_test_done; | ||
59 | |||
58 | static const struct platform_hibernation_ops *hibernation_ops; | 60 | static const struct platform_hibernation_ops *hibernation_ops; |
59 | 61 | ||
60 | /** | 62 | /** |
@@ -347,6 +349,17 @@ int hibernation_snapshot(int platform_mode) | |||
347 | if (error) | 349 | if (error) |
348 | goto Close; | 350 | goto Close; |
349 | 351 | ||
352 | if (hibernation_test(TEST_FREEZER) || | ||
353 | hibernation_testmode(HIBERNATION_TESTPROC)) { | ||
354 | |||
355 | /* | ||
356 | * Indicate to the caller that we are returning due to a | ||
357 | * successful freezer test. | ||
358 | */ | ||
359 | freezer_test_done = true; | ||
360 | goto Close; | ||
361 | } | ||
362 | |||
350 | error = dpm_prepare(PMSG_FREEZE); | 363 | error = dpm_prepare(PMSG_FREEZE); |
351 | if (error) | 364 | if (error) |
352 | goto Complete_devices; | 365 | goto Complete_devices; |
@@ -641,15 +654,13 @@ int hibernate(void) | |||
641 | if (error) | 654 | if (error) |
642 | goto Finish; | 655 | goto Finish; |
643 | 656 | ||
644 | if (hibernation_test(TEST_FREEZER)) | ||
645 | goto Thaw; | ||
646 | |||
647 | if (hibernation_testmode(HIBERNATION_TESTPROC)) | ||
648 | goto Thaw; | ||
649 | |||
650 | error = hibernation_snapshot(hibernation_mode == HIBERNATION_PLATFORM); | 657 | error = hibernation_snapshot(hibernation_mode == HIBERNATION_PLATFORM); |
651 | if (error) | 658 | if (error) |
652 | goto Thaw; | 659 | goto Thaw; |
660 | if (freezer_test_done) { | ||
661 | freezer_test_done = false; | ||
662 | goto Thaw; | ||
663 | } | ||
653 | 664 | ||
654 | if (in_suspend) { | 665 | if (in_suspend) { |
655 | unsigned int flags = 0; | 666 | unsigned int flags = 0; |