diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-04-28 01:54:29 +0200 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-04-28 01:54:29 +0200 |
commit | 355c63e5ac963af0ac95e72b74693cfe2527a76b (patch) | |
tree | cbec948ce4257c0d3a71ad9fecde5c0a64d51927 /kernel | |
parent | 0acaab5367a2c4140bd965a0ad3ea265af4d43ed (diff) | |
parent | cd787b345e82f7ea9c29d22c50cca29fadc53d76 (diff) | |
download | blackbird-op-linux-355c63e5ac963af0ac95e72b74693cfe2527a76b.tar.gz blackbird-op-linux-355c63e5ac963af0ac95e72b74693cfe2527a76b.zip |
Merge branch 'pm-assorted'
* pm-assorted:
PM / OPP: add documentation to RCU head in struct opp
PM / sleep: invalidate TEST_CPUS and TEST_CORE support for freeze state
PM / sleep: add TEST_PLATFORM support for freeze state
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/power/suspend.c | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/kernel/power/suspend.c b/kernel/power/suspend.c index d4feda084a3a..bef86d121eb2 100644 --- a/kernel/power/suspend.c +++ b/kernel/power/suspend.c @@ -76,8 +76,20 @@ EXPORT_SYMBOL_GPL(suspend_set_ops); bool valid_state(suspend_state_t state) { - if (state == PM_SUSPEND_FREEZE) - return true; + if (state == PM_SUSPEND_FREEZE) { +#ifdef CONFIG_PM_DEBUG + if (pm_test_level != TEST_NONE && + pm_test_level != TEST_FREEZER && + pm_test_level != TEST_DEVICES && + pm_test_level != TEST_PLATFORM) { + printk(KERN_WARNING "Unsupported pm_test mode for " + "freeze state, please choose " + "none/freezer/devices/platform.\n"); + return false; + } +#endif + return true; + } /* * PM_SUSPEND_STANDBY and PM_SUSPEND_MEMORY states need lowlevel * support and need to be valid to the lowlevel @@ -184,6 +196,9 @@ static int suspend_enter(suspend_state_t state, bool *wakeup) goto Platform_wake; } + if (suspend_test(TEST_PLATFORM)) + goto Platform_wake; + /* * PM_SUSPEND_FREEZE equals * frozen processes + suspended devices + idle processors. @@ -195,9 +210,6 @@ static int suspend_enter(suspend_state_t state, bool *wakeup) goto Platform_wake; } - if (suspend_test(TEST_PLATFORM)) - goto Platform_wake; - error = disable_nonboot_cpus(); if (error || suspend_test(TEST_CPUS)) goto Enable_cpus; |