Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 298608
b: refs/heads/master
c: 1e73203
h: refs/heads/master
v: v3
  • Loading branch information
Rafael J. Wysocki committed Mar 28, 2012
1 parent ded9ecf commit b1fc549
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 28 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7b5179ac14dbad945647ac9e76bbbf14ed9e0dbe
refs/heads/master: 1e73203cd1157a03facc41ffb54050f5b28e55bd
11 changes: 0 additions & 11 deletions trunk/kernel/power/hibernate.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
#include <linux/string.h>
#include <linux/device.h>
#include <linux/async.h>
#include <linux/kmod.h>
#include <linux/delay.h>
#include <linux/fs.h>
#include <linux/mount.h>
Expand Down Expand Up @@ -620,10 +619,6 @@ int hibernate(void)
sys_sync();
printk("done.\n");

error = usermodehelper_disable();
if (error)
goto Exit;

error = freeze_processes();
if (error)
goto Free_bitmaps;
Expand Down Expand Up @@ -660,7 +655,6 @@ int hibernate(void)
freezer_test_done = false;

Free_bitmaps:
usermodehelper_enable();
free_basic_memory_bitmaps();
Exit:
pm_notifier_call_chain(PM_POST_HIBERNATION);
Expand Down Expand Up @@ -780,10 +774,6 @@ static int software_resume(void)
if (error)
goto close_finish;

error = usermodehelper_disable();
if (error)
goto close_finish;

pr_debug("PM: Preparing processes for restore.\n");
error = freeze_processes();
if (error) {
Expand All @@ -802,7 +792,6 @@ static int software_resume(void)
swsusp_free();
thaw_processes();
Done:
usermodehelper_enable();
free_basic_memory_bitmaps();
Finish:
pm_notifier_call_chain(PM_POST_RESTORE);
Expand Down
7 changes: 7 additions & 0 deletions trunk/kernel/power/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include <linux/freezer.h>
#include <linux/delay.h>
#include <linux/workqueue.h>
#include <linux/kmod.h>

/*
* Timeout for stopping processes
Expand Down Expand Up @@ -122,6 +123,10 @@ int freeze_processes(void)
{
int error;

error = usermodehelper_disable();
if (error)
return error;

if (!pm_freezing)
atomic_inc(&system_freezing_cnt);

Expand Down Expand Up @@ -187,6 +192,8 @@ void thaw_processes(void)
} while_each_thread(g, p);
read_unlock(&tasklist_lock);

usermodehelper_enable();

schedule();
printk("done.\n");
}
Expand Down
7 changes: 0 additions & 7 deletions trunk/kernel/power/suspend.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
#include <linux/delay.h>
#include <linux/errno.h>
#include <linux/init.h>
#include <linux/kmod.h>
#include <linux/console.h>
#include <linux/cpu.h>
#include <linux/syscalls.h>
Expand Down Expand Up @@ -102,17 +101,12 @@ static int suspend_prepare(void)
if (error)
goto Finish;

error = usermodehelper_disable();
if (error)
goto Finish;

error = suspend_freeze_processes();
if (!error)
return 0;

suspend_stats.failed_freeze++;
dpm_save_failed_step(SUSPEND_FREEZE);
usermodehelper_enable();
Finish:
pm_notifier_call_chain(PM_POST_SUSPEND);
pm_restore_console();
Expand Down Expand Up @@ -259,7 +253,6 @@ int suspend_devices_and_enter(suspend_state_t state)
static void suspend_finish(void)
{
suspend_thaw_processes();
usermodehelper_enable();
pm_notifier_call_chain(PM_POST_SUSPEND);
pm_restore_console();
}
Expand Down
10 changes: 1 addition & 9 deletions trunk/kernel/power/user.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
#include <linux/suspend.h>
#include <linux/syscalls.h>
#include <linux/reboot.h>
#include <linux/kmod.h>
#include <linux/string.h>
#include <linux/device.h>
#include <linux/miscdevice.h>
Expand Down Expand Up @@ -222,14 +221,8 @@ static long snapshot_ioctl(struct file *filp, unsigned int cmd,
sys_sync();
printk("done.\n");

error = usermodehelper_disable();
if (error)
break;

error = freeze_processes();
if (error)
usermodehelper_enable();
else
if (!error)
data->frozen = 1;
break;

Expand All @@ -238,7 +231,6 @@ static long snapshot_ioctl(struct file *filp, unsigned int cmd,
break;
pm_restore_gfp_mask();
thaw_processes();
usermodehelper_enable();
data->frozen = 0;
break;

Expand Down

0 comments on commit b1fc549

Please sign in to comment.