Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 109292
b: refs/heads/master
c: 41108eb
h: refs/heads/master
v: v3
  • Loading branch information
Rafael J. Wysocki authored and Linus Torvalds committed Aug 28, 2008
1 parent 4072998 commit d8374fb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 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: b09331e530777963ed65ce2fdf074b7b077768c7
refs/heads/master: 41108eb10142e0552f2de1e4c0675b108c5f018f
13 changes: 10 additions & 3 deletions trunk/kernel/power/disk.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include <linux/console.h>
#include <linux/cpu.h>
#include <linux/freezer.h>
#include <linux/ftrace.h>

#include "power.h"

Expand Down Expand Up @@ -255,7 +256,7 @@ static int create_image(int platform_mode)

int hibernation_snapshot(int platform_mode)
{
int error;
int error, ftrace_save;

/* Free memory before shutting down devices. */
error = swsusp_shrink_memory();
Expand All @@ -267,6 +268,7 @@ int hibernation_snapshot(int platform_mode)
goto Close;

suspend_console();
ftrace_save = __ftrace_enabled_save();
error = device_suspend(PMSG_FREEZE);
if (error)
goto Recover_platform;
Expand Down Expand Up @@ -296,6 +298,7 @@ int hibernation_snapshot(int platform_mode)
Resume_devices:
device_resume(in_suspend ?
(error ? PMSG_RECOVER : PMSG_THAW) : PMSG_RESTORE);
__ftrace_enabled_restore(ftrace_save);
resume_console();
Close:
platform_end(platform_mode);
Expand Down Expand Up @@ -366,10 +369,11 @@ static int resume_target_kernel(void)

int hibernation_restore(int platform_mode)
{
int error;
int error, ftrace_save;

pm_prepare_console();
suspend_console();
ftrace_save = __ftrace_enabled_save();
error = device_suspend(PMSG_QUIESCE);
if (error)
goto Finish;
Expand All @@ -384,6 +388,7 @@ int hibernation_restore(int platform_mode)
platform_restore_cleanup(platform_mode);
device_resume(PMSG_RECOVER);
Finish:
__ftrace_enabled_restore(ftrace_save);
resume_console();
pm_restore_console();
return error;
Expand All @@ -396,7 +401,7 @@ int hibernation_restore(int platform_mode)

int hibernation_platform_enter(void)
{
int error;
int error, ftrace_save;

if (!hibernation_ops)
return -ENOSYS;
Expand All @@ -411,6 +416,7 @@ int hibernation_platform_enter(void)
goto Close;

suspend_console();
ftrace_save = __ftrace_enabled_save();
error = device_suspend(PMSG_HIBERNATE);
if (error) {
if (hibernation_ops->recover)
Expand Down Expand Up @@ -445,6 +451,7 @@ int hibernation_platform_enter(void)
hibernation_ops->finish();
Resume_devices:
device_resume(PMSG_RESTORE);
__ftrace_enabled_restore(ftrace_save);
resume_console();
Close:
hibernation_ops->end();
Expand Down

0 comments on commit d8374fb

Please sign in to comment.