]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - kernel/power/disk.c
pm: rework disabling of user mode helpers during suspend/hibernation
[linux-2.6-omap-h63xx.git] / kernel / power / disk.c
index bbd85c60f7419f5fca1cbf1d0b5d6e6aad37f625..331f9836383feaba687c89c3e4596edff76fb2fe 100644 (file)
@@ -14,6 +14,7 @@
 #include <linux/reboot.h>
 #include <linux/string.h>
 #include <linux/device.h>
+#include <linux/kmod.h>
 #include <linux/delay.h>
 #include <linux/fs.h>
 #include <linux/mount.h>
@@ -520,6 +521,10 @@ int hibernate(void)
        if (error)
                goto Exit;
 
+       error = usermodehelper_disable();
+       if (error)
+               goto Exit;
+
        /* Allocate memory management structures */
        error = create_basic_memory_bitmaps();
        if (error)
@@ -558,6 +563,7 @@ int hibernate(void)
        thaw_processes();
  Finish:
        free_basic_memory_bitmaps();
+       usermodehelper_enable();
  Exit:
        pm_notifier_call_chain(PM_POST_HIBERNATION);
        pm_restore_console();
@@ -634,6 +640,10 @@ static int software_resume(void)
        if (error)
                goto Finish;
 
+       error = usermodehelper_disable();
+       if (error)
+               goto Finish;
+
        error = create_basic_memory_bitmaps();
        if (error)
                goto Finish;
@@ -656,6 +666,7 @@ static int software_resume(void)
        thaw_processes();
  Done:
        free_basic_memory_bitmaps();
+       usermodehelper_enable();
  Finish:
        pm_notifier_call_chain(PM_POST_RESTORE);
        pm_restore_console();