Merge branches 'pm-avs', 'pm-clk', 'pm-devfreq' and 'pm-sleep'
[cascardo/linux.git] / kernel / power / hibernate.c
index b7342a2..fca9254 100644 (file)
@@ -339,6 +339,7 @@ int hibernation_snapshot(int platform_mode)
        pm_message_t msg;
        int error;
 
+       pm_suspend_clear_flags();
        error = platform_begin(platform_mode);
        if (error)
                goto Close;
@@ -1158,6 +1159,22 @@ static int __init kaslr_nohibernate_setup(char *str)
        return nohibernate_setup(str);
 }
 
+static int __init page_poison_nohibernate_setup(char *str)
+{
+#ifdef CONFIG_PAGE_POISONING_ZERO
+       /*
+        * The zeroing option for page poison skips the checks on alloc.
+        * since hibernation doesn't save free pages there's no way to
+        * guarantee the pages will still be zeroed.
+        */
+       if (!strcmp(str, "on")) {
+               pr_info("Disabling hibernation due to page poisoning\n");
+               return nohibernate_setup(str);
+       }
+#endif
+       return 1;
+}
+
 __setup("noresume", noresume_setup);
 __setup("resume_offset=", resume_offset_setup);
 __setup("resume=", resume_setup);
@@ -1166,3 +1183,4 @@ __setup("resumewait", resumewait_setup);
 __setup("resumedelay=", resumedelay_setup);
 __setup("nohibernate", nohibernate_setup);
 __setup("kaslr", kaslr_nohibernate_setup);
+__setup("page_poison=", page_poison_nohibernate_setup);