Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 275628
b: refs/heads/master
c: aa9a7b1
h: refs/heads/master
v: v3
  • Loading branch information
Srivatsa S. Bhat authored and Rafael J. Wysocki committed Nov 18, 2011
1 parent da02caa commit 76c986f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 88995e809f8a8115f30db24696c9137aad93d570
refs/heads/master: aa9a7b11821e883a7b93ecce190881e0ea48648b
23 changes: 17 additions & 6 deletions trunk/kernel/power/hibernate.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ enum {

static int hibernation_mode = HIBERNATION_SHUTDOWN;

static bool freezer_test_done;

static const struct platform_hibernation_ops *hibernation_ops;

/**
Expand Down Expand Up @@ -347,6 +349,17 @@ int hibernation_snapshot(int platform_mode)
if (error)
goto Close;

if (hibernation_test(TEST_FREEZER) ||
hibernation_testmode(HIBERNATION_TESTPROC)) {

/*
* Indicate to the caller that we are returning due to a
* successful freezer test.
*/
freezer_test_done = true;
goto Close;
}

error = dpm_prepare(PMSG_FREEZE);
if (error)
goto Complete_devices;
Expand Down Expand Up @@ -641,15 +654,13 @@ int hibernate(void)
if (error)
goto Finish;

if (hibernation_test(TEST_FREEZER))
goto Thaw;

if (hibernation_testmode(HIBERNATION_TESTPROC))
goto Thaw;

error = hibernation_snapshot(hibernation_mode == HIBERNATION_PLATFORM);
if (error)
goto Thaw;
if (freezer_test_done) {
freezer_test_done = false;
goto Thaw;
}

if (in_suspend) {
unsigned int flags = 0;
Expand Down

0 comments on commit 76c986f

Please sign in to comment.