summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--kernel/power/hibernate.c4
-rw-r--r--kernel/power/user.c2
-rw-r--r--mm/memory_hotplug.c4
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)
if (error)
goto Exit;
+ lock_device_hotplug();
/* Allocate memory management structures */
error = create_basic_memory_bitmaps();
if (error)
@@ -685,6 +686,7 @@ int hibernate(void)
Free_bitmaps:
free_basic_memory_bitmaps();
Thaw:
+ unlock_device_hotplug();
thaw_processes();
/* Don't bother checking whether freezer_test_done is true */
@@ -814,6 +816,7 @@ static int software_resume(void)
pr_debug("PM: Loading hibernation image.\n");
+ lock_device_hotplug();
error = create_basic_memory_bitmaps();
if (error)
goto Thaw;
@@ -827,6 +830,7 @@ static int software_resume(void)
swsusp_free();
free_basic_memory_bitmaps();
Thaw:
+ unlock_device_hotplug();
thaw_processes();
Finish:
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,
if (!mutex_trylock(&pm_mutex))
return -EBUSY;
+ lock_device_hotplug();
data = filp->private_data;
switch (cmd) {
@@ -373,6 +374,7 @@ static long snapshot_ioctl(struct file *filp, unsigned int cmd,
}
+ unlock_device_hotplug();
mutex_unlock(&pm_mutex);
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);
void lock_memory_hotplug(void)
{
mutex_lock(&mem_hotplug_mutex);
-
- /* for exclusive hibernation if CONFIG_HIBERNATION=y */
- lock_system_sleep();
}
void unlock_memory_hotplug(void)
{
- unlock_system_sleep();
mutex_unlock(&mem_hotplug_mutex);
}