Skip to content

Commit

Permalink
PM/resume: wait for device probing to finish
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Arjan van de Ven authored and Linus Torvalds committed Feb 21, 2009
1 parent 216773a commit eed3ee0
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions kernel/power/disk.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 {
Expand Down

0 comments on commit eed3ee0

Please sign in to comment.