aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorArjan van de Ven <arjan@linux.intel.com>2009-02-13 20:00:19 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2009-02-21 17:17:17 -0500
commiteed3ee08292d821282169708e5e8e89a0d0a0c63 (patch)
tree0c455705568521c99c84d9ef095a3ae29d1f02db /kernel
parent216773a787c3c46ef26bf1742c1fdba37d26be45 (diff)
PM/resume: wait for device probing to finish
the resume code does not currently wait for device probing to finish. Even without async function calls this is dicey and not correct, but with async function calls during the boot sequence this is going to get hit more... This patch adds the synchronization using the newly introduced helper. Signed-off-by: Arjan van de Ven <arjan@linux.intel.com> Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Cc: Len Brown <lenb@kernel.org> Acked-by: Greg KH <gregkh@suse.de> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/power/disk.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/kernel/power/disk.c b/kernel/power/disk.c
index 432ee575c9ee..7b40e94b1d42 100644
--- a/kernel/power/disk.c
+++ b/kernel/power/disk.c
@@ -595,6 +595,12 @@ static int software_resume(void)
595 unsigned int flags; 595 unsigned int flags;
596 596
597 /* 597 /*
598 * If the user said "noresume".. bail out early.
599 */
600 if (noresume)
601 return 0;
602
603 /*
598 * name_to_dev_t() below takes a sysfs buffer mutex when sysfs 604 * name_to_dev_t() below takes a sysfs buffer mutex when sysfs
599 * is configured into the kernel. Since the regular hibernate 605 * is configured into the kernel. Since the regular hibernate
600 * trigger path is via sysfs which takes a buffer mutex before 606 * trigger path is via sysfs which takes a buffer mutex before
@@ -610,6 +616,11 @@ static int software_resume(void)
610 mutex_unlock(&pm_mutex); 616 mutex_unlock(&pm_mutex);
611 return -ENOENT; 617 return -ENOENT;
612 } 618 }
619 /*
620 * Some device discovery might still be in progress; we need
621 * to wait for this to finish.
622 */
623 wait_for_device_probe();
613 swsusp_resume_device = name_to_dev_t(resume_file); 624 swsusp_resume_device = name_to_dev_t(resume_file);
614 pr_debug("PM: Resume from partition %s\n", resume_file); 625 pr_debug("PM: Resume from partition %s\n", resume_file);
615 } else { 626 } else {