]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - kernel/power/disk.c
Hibernation: Introduce system_entering_hibernation
[linux-2.6-omap-h63xx.git] / kernel / power / disk.c
index 096fe4899ea4b40f2783c32da6cf8be43048a208..432ee575c9ee4fd201481a9ebdb674c29b96dab8 100644 (file)
@@ -22,7 +22,6 @@
 #include <linux/console.h>
 #include <linux/cpu.h>
 #include <linux/freezer.h>
-#include <linux/ftrace.h>
 
 #include "power.h"
 
@@ -72,6 +71,14 @@ void hibernation_set_ops(struct platform_hibernation_ops *ops)
        mutex_unlock(&pm_mutex);
 }
 
+static bool entering_platform_hibernation;
+
+bool system_entering_hibernation(void)
+{
+       return entering_platform_hibernation;
+}
+EXPORT_SYMBOL(system_entering_hibernation);
+
 #ifdef CONFIG_PM_DEBUG
 static void hibernation_debug_sleep(void)
 {
@@ -257,7 +264,7 @@ static int create_image(int platform_mode)
 
 int hibernation_snapshot(int platform_mode)
 {
-       int error, ftrace_save;
+       int error;
 
        error = platform_begin(platform_mode);
        if (error)
@@ -269,7 +276,6 @@ 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;
@@ -299,7 +305,6 @@ 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);
@@ -370,11 +375,10 @@ static int resume_target_kernel(void)
 
 int hibernation_restore(int platform_mode)
 {
-       int error, ftrace_save;
+       int error;
 
        pm_prepare_console();
        suspend_console();
-       ftrace_save = __ftrace_enabled_save();
        error = device_suspend(PMSG_QUIESCE);
        if (error)
                goto Finish;
@@ -389,7 +393,6 @@ 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;
@@ -402,7 +405,7 @@ int hibernation_restore(int platform_mode)
 
 int hibernation_platform_enter(void)
 {
-       int error, ftrace_save;
+       int error;
 
        if (!hibernation_ops)
                return -ENOSYS;
@@ -416,8 +419,8 @@ int hibernation_platform_enter(void)
        if (error)
                goto Close;
 
+       entering_platform_hibernation = true;
        suspend_console();
-       ftrace_save = __ftrace_enabled_save();
        error = device_suspend(PMSG_HIBERNATE);
        if (error) {
                if (hibernation_ops->recover)
@@ -451,8 +454,8 @@ int hibernation_platform_enter(void)
  Finish:
        hibernation_ops->finish();
  Resume_devices:
+       entering_platform_hibernation = false;
        device_resume(PMSG_RESTORE);
-       __ftrace_enabled_restore(ftrace_save);
        resume_console();
  Close:
        hibernation_ops->end();