Skip to content

Commit

Permalink
PM / sleep: add TEST_PLATFORM support for freeze state
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Rafael J. Wysocki <[email protected]>
  • Loading branch information
zhang-rui authored and rafaeljw committed Apr 5, 2013
1 parent d08d528 commit 08605ac
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions kernel/power/suspend.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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;
Expand Down

0 comments on commit 08605ac

Please sign in to comment.