]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - kernel/power/hibernate.c
PM / hibernate / memory hotplug: Rework mutual exclusion
[karo-tx-linux.git] / kernel / power / hibernate.c
index d4e54053d009faf3ad1acd663f022e7daeed8e4e..0b78f72ad39d3ccb3629af5c9d2aafb85ed8a78f 100644 (file)
@@ -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);