]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - kernel/power/main.c
device create: infiniband: convert device_create_drvdata to device_create
[linux-2.6-omap-h63xx.git] / kernel / power / main.c
index 95bff23ecdaae70e69d308baef69efb75a554b7f..540b16b68565e74fb9f51f68134f68cc3011b0a0 100644 (file)
@@ -21,6 +21,7 @@
 #include <linux/freezer.h>
 #include <linux/vmstat.h>
 #include <linux/syscalls.h>
+#include <linux/ftrace.h>
 
 #include "power.h"
 
@@ -310,7 +311,7 @@ static int suspend_enter(suspend_state_t state)
  */
 int suspend_devices_and_enter(suspend_state_t state)
 {
-       int error;
+       int error, ftrace_save;
 
        if (!suspend_ops)
                return -ENOSYS;
@@ -321,6 +322,7 @@ int suspend_devices_and_enter(suspend_state_t state)
                        goto Close;
        }
        suspend_console();
+       ftrace_save = __ftrace_enabled_save();
        suspend_test_start();
        error = device_suspend(PMSG_SUSPEND);
        if (error) {
@@ -352,6 +354,7 @@ int suspend_devices_and_enter(suspend_state_t state)
        suspend_test_start();
        device_resume(PMSG_RESUME);
        suspend_test_finish("resume devices");
+       __ftrace_enabled_restore(ftrace_save);
        resume_console();
  Close:
        if (suspend_ops->end)
@@ -635,6 +638,13 @@ static void __init test_wakealarm(struct rtc_device *rtc, suspend_state_t state)
        }
        if (status < 0)
                printk(err_suspend, status);
+
+       /* Some platforms can't detect that the alarm triggered the
+        * wakeup, or (accordingly) disable it after it afterwards.
+        * It's supposed to give oneshot behavior; cope.
+        */
+       alm.enabled = false;
+       rtc_set_alarm(rtc, &alm);
 }
 
 static int __init has_wakealarm(struct device *dev, void *name_ptr)