From: Zhang Rui Date: Wed, 27 Mar 2013 03:36:10 +0000 (+0000) Subject: PM / sleep: add TEST_PLATFORM support for freeze state X-Git-Tag: v3.12-rc1~830^2~7^2~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=08605acc7e3b7974e309d73ddf39ee9464d95e51;p=kernel%2Fkernel-generic.git PM / sleep: add TEST_PLATFORM support for freeze state Invoke freeze_enter() after suspend_test(TEST_PLATFORM) being invoked. So when setting /sys/power/pm_test to "platform", it can be used to check if freeze state is working well after all devices are suspended and before processors are blocked, Signed-off-by: Zhang Rui Signed-off-by: Rafael J. Wysocki --- diff --git a/kernel/power/suspend.c b/kernel/power/suspend.c index d4feda0..5eb30aa 100644 --- a/kernel/power/suspend.c +++ b/kernel/power/suspend.c @@ -184,6 +184,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 +198,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;