aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/power/hibernate.c
diff options
context:
space:
mode:
authorRafael J. Wysocki <rjw@sisk.pl>2012-03-28 17:30:21 -0400
committerRafael J. Wysocki <rjw@sisk.pl>2012-03-28 17:30:21 -0400
commit1e73203cd1157a03facc41ffb54050f5b28e55bd (patch)
tree12781ea69aa706291949bb1a10141a8a043e09d9 /kernel/power/hibernate.c
parent7b5179ac14dbad945647ac9e76bbbf14ed9e0dbe (diff)
PM / Sleep: Move disabling of usermode helpers to the freezer
The core suspend/hibernation code calls usermodehelper_disable() to avoid race conditions between the freezer and the starting of usermode helpers and each code path has to do that on its own. However, it is always called right before freeze_processes() and usermodehelper_enable() is always called right after thaw_processes(). For this reason, to avoid code duplication and to make the connection between usermodehelper_disable() and the freezer more visible, make freeze_processes() call it and remove the direct usermodehelper_disable() and usermodehelper_enable() calls from all suspend/hibernation code paths. Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: stable@vger.kernel.org
Diffstat (limited to 'kernel/power/hibernate.c')
-rw-r--r--kernel/power/hibernate.c11
1 files changed, 0 insertions, 11 deletions
diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c
index 639ff6e4ae9e..e09dfbfeecee 100644
--- a/kernel/power/hibernate.c
+++ b/kernel/power/hibernate.c
@@ -16,7 +16,6 @@
16#include <linux/string.h> 16#include <linux/string.h>
17#include <linux/device.h> 17#include <linux/device.h>
18#include <linux/async.h> 18#include <linux/async.h>
19#include <linux/kmod.h>
20#include <linux/delay.h> 19#include <linux/delay.h>
21#include <linux/fs.h> 20#include <linux/fs.h>
22#include <linux/mount.h> 21#include <linux/mount.h>
@@ -620,10 +619,6 @@ int hibernate(void)
620 sys_sync(); 619 sys_sync();
621 printk("done.\n"); 620 printk("done.\n");
622 621
623 error = usermodehelper_disable();
624 if (error)
625 goto Exit;
626
627 error = freeze_processes(); 622 error = freeze_processes();
628 if (error) 623 if (error)
629 goto Free_bitmaps; 624 goto Free_bitmaps;
@@ -660,7 +655,6 @@ int hibernate(void)
660 freezer_test_done = false; 655 freezer_test_done = false;
661 656
662 Free_bitmaps: 657 Free_bitmaps:
663 usermodehelper_enable();
664 free_basic_memory_bitmaps(); 658 free_basic_memory_bitmaps();
665 Exit: 659 Exit:
666 pm_notifier_call_chain(PM_POST_HIBERNATION); 660 pm_notifier_call_chain(PM_POST_HIBERNATION);
@@ -780,10 +774,6 @@ static int software_resume(void)
780 if (error) 774 if (error)
781 goto close_finish; 775 goto close_finish;
782 776
783 error = usermodehelper_disable();
784 if (error)
785 goto close_finish;
786
787 pr_debug("PM: Preparing processes for restore.\n"); 777 pr_debug("PM: Preparing processes for restore.\n");
788 error = freeze_processes(); 778 error = freeze_processes();
789 if (error) { 779 if (error) {
@@ -802,7 +792,6 @@ static int software_resume(void)
802 swsusp_free(); 792 swsusp_free();
803 thaw_processes(); 793 thaw_processes();
804 Done: 794 Done:
805 usermodehelper_enable();
806 free_basic_memory_bitmaps(); 795 free_basic_memory_bitmaps();
807 Finish: 796 Finish:
808 pm_notifier_call_chain(PM_POST_RESTORE); 797 pm_notifier_call_chain(PM_POST_RESTORE);