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>

authored by

Arjan van de Ven and committed by
Linus Torvalds
eed3ee08 216773a7

+11
+11
kernel/power/disk.c
··· 595 unsigned int flags; 596 597 /* 598 * name_to_dev_t() below takes a sysfs buffer mutex when sysfs 599 * is configured into the kernel. Since the regular hibernate 600 * trigger path is via sysfs which takes a buffer mutex before ··· 616 mutex_unlock(&pm_mutex); 617 return -ENOENT; 618 } 619 swsusp_resume_device = name_to_dev_t(resume_file); 620 pr_debug("PM: Resume from partition %s\n", resume_file); 621 } else {
··· 595 unsigned int flags; 596 597 /* 598 + * If the user said "noresume".. bail out early. 599 + */ 600 + if (noresume) 601 + return 0; 602 + 603 + /* 604 * name_to_dev_t() below takes a sysfs buffer mutex when sysfs 605 * is configured into the kernel. Since the regular hibernate 606 * trigger path is via sysfs which takes a buffer mutex before ··· 610 mutex_unlock(&pm_mutex); 611 return -ENOENT; 612 } 613 + /* 614 + * Some device discovery might still be in progress; we need 615 + * to wait for this to finish. 616 + */ 617 + wait_for_device_probe(); 618 swsusp_resume_device = name_to_dev_t(resume_file); 619 pr_debug("PM: Resume from partition %s\n", resume_file); 620 } else {