]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - kernel/power/disk.c
PM/resume: wait for device probing to finish
[mv-sheeva.git] / kernel / power / disk.c
index 432ee575c9ee4fd201481a9ebdb674c29b96dab8..7b40e94b1d42983c301eabd7b40340758ad18593 100644 (file)
@@ -594,6 +594,12 @@ static int software_resume(void)
        int error;
        unsigned int flags;
 
+       /*
+        * If the user said "noresume".. bail out early.
+        */
+       if (noresume)
+               return 0;
+
        /*
         * name_to_dev_t() below takes a sysfs buffer mutex when sysfs
         * is configured into the kernel. Since the regular hibernate
@@ -610,6 +616,11 @@ static int software_resume(void)
                        mutex_unlock(&pm_mutex);
                        return -ENOENT;
                }
+               /*
+                * Some device discovery might still be in progress; we need
+                * to wait for this to finish.
+                */
+               wait_for_device_probe();
                swsusp_resume_device = name_to_dev_t(resume_file);
                pr_debug("PM: Resume from partition %s\n", resume_file);
        } else {