Commit c26b78a2d826a89cd689527493a2bea22af46133
Committed by
Rafael J. Wysocki
1 parent
08605acc7e
Exists in
smarc-l5.0.0_1.0.0-ga
and in
5 other branches
PM / sleep: invalidate TEST_CPUS and TEST_CORE support for freeze state
freeze state is a software suspend state that does not run into low-level platform callbacks which may interact with BIOS. And freeze state does not need to disable the processors. But the current pm_test support misleads users because users can enter freeze state with pm_test set to TEST_CPUS/TEST_CORE, while this pm_test setting never takes actions. So, invalidate TEST_CPUS/TEST_CORE for freeze state in this patch. Then users will get an error instead, when trying to enter freeze state with pm_test mode set to TEST_CPUS/TEST_CORE. Signed-off-by: Zhang Rui <rui.zhang@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Showing 1 changed file with 14 additions and 2 deletions Side-by-side Diff
kernel/power/suspend.c
... | ... | @@ -76,8 +76,20 @@ |
76 | 76 | |
77 | 77 | bool valid_state(suspend_state_t state) |
78 | 78 | { |
79 | - if (state == PM_SUSPEND_FREEZE) | |
80 | - return true; | |
79 | + if (state == PM_SUSPEND_FREEZE) { | |
80 | +#ifdef CONFIG_PM_DEBUG | |
81 | + if (pm_test_level != TEST_NONE && | |
82 | + pm_test_level != TEST_FREEZER && | |
83 | + pm_test_level != TEST_DEVICES && | |
84 | + pm_test_level != TEST_PLATFORM) { | |
85 | + printk(KERN_WARNING "Unsupported pm_test mode for " | |
86 | + "freeze state, please choose " | |
87 | + "none/freezer/devices/platform.\n"); | |
88 | + return false; | |
89 | + } | |
90 | +#endif | |
91 | + return true; | |
92 | + } | |
81 | 93 | /* |
82 | 94 | * PM_SUSPEND_STANDBY and PM_SUSPEND_MEMORY states need lowlevel |
83 | 95 | * support and need to be valid to the lowlevel |