diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-11-20 17:33:02 -0500 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-11-20 17:33:02 -0500 |
| commit | 2d360fcbd851b7f9f8c23b1c30b2f3c060fa43e6 (patch) | |
| tree | 8228db95030b82921c90b95f353441946af3a677 /kernel | |
| parent | a767835f6dc85277e40fbfe69a29c18817d6c00b (diff) | |
| parent | 501a708f18ef911328ffd39f39738b8a7862aa8e (diff) | |
Merge branch 'pm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
* 'pm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
PM / Suspend: Fix bug in suspend statistics update
PM / Hibernate: Fix the early termination of test modes
PM / shmobile: Fix build of sh7372_pm_init() for CONFIG_PM unset
PM Sleep: Do not extend wakeup paths to devices with ignore_children set
PM / driver core: disable device's runtime PM during shutdown
PM / devfreq: correct Kconfig dependency
PM / devfreq: fix use after free in devfreq_remove_device
PM / shmobile: Avoid restoring the INTCS state during initialization
PM / devfreq: Remove compiler error after irq.h update
PM / QoS: Properly use the WARN() macro in dev_pm_qos_add_request()
PM / Clocks: Only disable enabled clocks in pm_clk_suspend()
ARM: mach-shmobile: sh7372 A3SP no_suspend_console fix
PM / shmobile: Don't skip debugging output in pd_power_up()
Diffstat (limited to 'kernel')
| -rw-r--r-- | kernel/power/hibernate.c | 23 | ||||
| -rw-r--r-- | kernel/power/main.c | 3 |
2 files changed, 19 insertions, 7 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; |
diff --git a/kernel/power/main.c b/kernel/power/main.c index 71f49fe4377e..36e0f0903c32 100644 --- a/kernel/power/main.c +++ b/kernel/power/main.c | |||
| @@ -290,13 +290,14 @@ static ssize_t state_store(struct kobject *kobj, struct kobj_attribute *attr, | |||
| 290 | if (*s && len == strlen(*s) && !strncmp(buf, *s, len)) | 290 | if (*s && len == strlen(*s) && !strncmp(buf, *s, len)) |
| 291 | break; | 291 | break; |
| 292 | } | 292 | } |
| 293 | if (state < PM_SUSPEND_MAX && *s) | 293 | if (state < PM_SUSPEND_MAX && *s) { |
| 294 | error = enter_state(state); | 294 | error = enter_state(state); |
| 295 | if (error) { | 295 | if (error) { |
| 296 | suspend_stats.fail++; | 296 | suspend_stats.fail++; |
| 297 | dpm_save_failed_errno(error); | 297 | dpm_save_failed_errno(error); |
| 298 | } else | 298 | } else |
| 299 | suspend_stats.success++; | 299 | suspend_stats.success++; |
| 300 | } | ||
| 300 | #endif | 301 | #endif |
| 301 | 302 | ||
| 302 | Exit: | 303 | Exit: |
