diff options
-rw-r--r-- | kernel/power/hibernate.c | 4 | ||||
-rw-r--r-- | kernel/power/user.c | 2 | ||||
-rw-r--r-- | mm/memory_hotplug.c | 4 |
3 files changed, 6 insertions, 4 deletions
diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c index d4e54053d009..0b78f72ad39d 100644 --- a/kernel/power/hibernate.c +++ b/kernel/power/hibernate.c | |||
@@ -652,6 +652,7 @@ int hibernate(void) | |||
652 | if (error) | 652 | if (error) |
653 | goto Exit; | 653 | goto Exit; |
654 | 654 | ||
655 | lock_device_hotplug(); | ||
655 | /* Allocate memory management structures */ | 656 | /* Allocate memory management structures */ |
656 | error = create_basic_memory_bitmaps(); | 657 | error = create_basic_memory_bitmaps(); |
657 | if (error) | 658 | if (error) |
@@ -685,6 +686,7 @@ int hibernate(void) | |||
685 | Free_bitmaps: | 686 | Free_bitmaps: |
686 | free_basic_memory_bitmaps(); | 687 | free_basic_memory_bitmaps(); |
687 | Thaw: | 688 | Thaw: |
689 | unlock_device_hotplug(); | ||
688 | thaw_processes(); | 690 | thaw_processes(); |
689 | 691 | ||
690 | /* Don't bother checking whether freezer_test_done is true */ | 692 | /* Don't bother checking whether freezer_test_done is true */ |
@@ -814,6 +816,7 @@ static int software_resume(void) | |||
814 | 816 | ||
815 | pr_debug("PM: Loading hibernation image.\n"); | 817 | pr_debug("PM: Loading hibernation image.\n"); |
816 | 818 | ||
819 | lock_device_hotplug(); | ||
817 | error = create_basic_memory_bitmaps(); | 820 | error = create_basic_memory_bitmaps(); |
818 | if (error) | 821 | if (error) |
819 | goto Thaw; | 822 | goto Thaw; |
@@ -827,6 +830,7 @@ static int software_resume(void) | |||
827 | swsusp_free(); | 830 | swsusp_free(); |
828 | free_basic_memory_bitmaps(); | 831 | free_basic_memory_bitmaps(); |
829 | Thaw: | 832 | Thaw: |
833 | unlock_device_hotplug(); | ||
830 | thaw_processes(); | 834 | thaw_processes(); |
831 | Finish: | 835 | Finish: |
832 | pm_notifier_call_chain(PM_POST_RESTORE); | 836 | pm_notifier_call_chain(PM_POST_RESTORE); |
diff --git a/kernel/power/user.c b/kernel/power/user.c index 63368163e98d..72e8f4fd616d 100644 --- a/kernel/power/user.c +++ b/kernel/power/user.c | |||
@@ -201,6 +201,7 @@ static long snapshot_ioctl(struct file *filp, unsigned int cmd, | |||
201 | if (!mutex_trylock(&pm_mutex)) | 201 | if (!mutex_trylock(&pm_mutex)) |
202 | return -EBUSY; | 202 | return -EBUSY; |
203 | 203 | ||
204 | lock_device_hotplug(); | ||
204 | data = filp->private_data; | 205 | data = filp->private_data; |
205 | 206 | ||
206 | switch (cmd) { | 207 | switch (cmd) { |
@@ -373,6 +374,7 @@ static long snapshot_ioctl(struct file *filp, unsigned int cmd, | |||
373 | 374 | ||
374 | } | 375 | } |
375 | 376 | ||
377 | unlock_device_hotplug(); | ||
376 | mutex_unlock(&pm_mutex); | 378 | mutex_unlock(&pm_mutex); |
377 | 379 | ||
378 | return error; | 380 | return error; |
diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c index ca1dd3aa5eee..53ad1325d7a7 100644 --- a/mm/memory_hotplug.c +++ b/mm/memory_hotplug.c | |||
@@ -51,14 +51,10 @@ DEFINE_MUTEX(mem_hotplug_mutex); | |||
51 | void lock_memory_hotplug(void) | 51 | void lock_memory_hotplug(void) |
52 | { | 52 | { |
53 | mutex_lock(&mem_hotplug_mutex); | 53 | mutex_lock(&mem_hotplug_mutex); |
54 | |||
55 | /* for exclusive hibernation if CONFIG_HIBERNATION=y */ | ||
56 | lock_system_sleep(); | ||
57 | } | 54 | } |
58 | 55 | ||
59 | void unlock_memory_hotplug(void) | 56 | void unlock_memory_hotplug(void) |
60 | { | 57 | { |
61 | unlock_system_sleep(); | ||
62 | mutex_unlock(&mem_hotplug_mutex); | 58 | mutex_unlock(&mem_hotplug_mutex); |
63 | } | 59 | } |
64 | 60 | ||