diff options
author | Rafael J. Wysocki <rjw@sisk.pl> | 2012-03-28 17:30:14 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rjw@sisk.pl> | 2012-03-28 17:30:14 -0400 |
commit | 7b5179ac14dbad945647ac9e76bbbf14ed9e0dbe (patch) | |
tree | 39213e51f3a19f3198929456f8ab4210a906674d /kernel/power | |
parent | 9b78c1da60b3c62ccdd1509f0902ad19ceaf776b (diff) |
PM / Hibernate: Disable usermode helpers right before freezing tasks
There is no reason to call usermodehelper_disable() before creating
memory bitmaps in hibernate() and software_resume(), so call it right
before freeze_processes(), in accordance with the other suspend and
hibernation code. Consequently, call usermodehelper_enable() right
after the thawing of tasks rather than after freeing the memory
bitmaps.
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')
-rw-r--r-- | kernel/power/hibernate.c | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c index 0a186cfde788..639ff6e4ae9e 100644 --- a/kernel/power/hibernate.c +++ b/kernel/power/hibernate.c | |||
@@ -611,19 +611,19 @@ int hibernate(void) | |||
611 | if (error) | 611 | if (error) |
612 | goto Exit; | 612 | goto Exit; |
613 | 613 | ||
614 | error = usermodehelper_disable(); | ||
615 | if (error) | ||
616 | goto Exit; | ||
617 | |||
618 | /* Allocate memory management structures */ | 614 | /* Allocate memory management structures */ |
619 | error = create_basic_memory_bitmaps(); | 615 | error = create_basic_memory_bitmaps(); |
620 | if (error) | 616 | if (error) |
621 | goto Enable_umh; | 617 | goto Exit; |
622 | 618 | ||
623 | printk(KERN_INFO "PM: Syncing filesystems ... "); | 619 | printk(KERN_INFO "PM: Syncing filesystems ... "); |
624 | sys_sync(); | 620 | sys_sync(); |
625 | printk("done.\n"); | 621 | printk("done.\n"); |
626 | 622 | ||
623 | error = usermodehelper_disable(); | ||
624 | if (error) | ||
625 | goto Exit; | ||
626 | |||
627 | error = freeze_processes(); | 627 | error = freeze_processes(); |
628 | if (error) | 628 | if (error) |
629 | goto Free_bitmaps; | 629 | goto Free_bitmaps; |
@@ -660,9 +660,8 @@ int hibernate(void) | |||
660 | freezer_test_done = false; | 660 | freezer_test_done = false; |
661 | 661 | ||
662 | Free_bitmaps: | 662 | Free_bitmaps: |
663 | free_basic_memory_bitmaps(); | ||
664 | Enable_umh: | ||
665 | usermodehelper_enable(); | 663 | usermodehelper_enable(); |
664 | free_basic_memory_bitmaps(); | ||
666 | Exit: | 665 | Exit: |
667 | pm_notifier_call_chain(PM_POST_HIBERNATION); | 666 | pm_notifier_call_chain(PM_POST_HIBERNATION); |
668 | pm_restore_console(); | 667 | pm_restore_console(); |
@@ -777,15 +776,13 @@ static int software_resume(void) | |||
777 | if (error) | 776 | if (error) |
778 | goto close_finish; | 777 | goto close_finish; |
779 | 778 | ||
780 | error = usermodehelper_disable(); | 779 | error = create_basic_memory_bitmaps(); |
781 | if (error) | 780 | if (error) |
782 | goto close_finish; | 781 | goto close_finish; |
783 | 782 | ||
784 | error = create_basic_memory_bitmaps(); | 783 | error = usermodehelper_disable(); |
785 | if (error) { | 784 | if (error) |
786 | usermodehelper_enable(); | ||
787 | goto close_finish; | 785 | goto close_finish; |
788 | } | ||
789 | 786 | ||
790 | pr_debug("PM: Preparing processes for restore.\n"); | 787 | pr_debug("PM: Preparing processes for restore.\n"); |
791 | error = freeze_processes(); | 788 | error = freeze_processes(); |
@@ -805,8 +802,8 @@ static int software_resume(void) | |||
805 | swsusp_free(); | 802 | swsusp_free(); |
806 | thaw_processes(); | 803 | thaw_processes(); |
807 | Done: | 804 | Done: |
808 | free_basic_memory_bitmaps(); | ||
809 | usermodehelper_enable(); | 805 | usermodehelper_enable(); |
806 | free_basic_memory_bitmaps(); | ||
810 | Finish: | 807 | Finish: |
811 | pm_notifier_call_chain(PM_POST_RESTORE); | 808 | pm_notifier_call_chain(PM_POST_RESTORE); |
812 | pm_restore_console(); | 809 | pm_restore_console(); |