Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 144157
b: refs/heads/master
c: 0c8454f
h: refs/heads/master
i:
  144155: c7da80b
v: v3
  • Loading branch information
Rafael J. Wysocki authored and Linus Torvalds committed Apr 24, 2009
1 parent d9d35d7 commit 81041a1
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 25 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4b2b0b9753194cad44d7295c32044b89710efd70
refs/heads/master: 0c8454f56623505a99463405fd7d5664adfbb094
51 changes: 27 additions & 24 deletions trunk/kernel/power/disk.c
Original file line number Diff line number Diff line change
Expand Up @@ -645,13 +645,6 @@ static int software_resume(void)
if (noresume)
return 0;

/*
* We can't depend on SCSI devices being available after loading one of
* their modules if scsi_complete_async_scans() is not called and the
* resume device usually is a SCSI one.
*/
scsi_complete_async_scans();

/*
* name_to_dev_t() below takes a sysfs buffer mutex when sysfs
* is configured into the kernel. Since the regular hibernate
Expand All @@ -663,32 +656,42 @@ static int software_resume(void)
* here to avoid lockdep complaining.
*/
mutex_lock_nested(&pm_mutex, SINGLE_DEPTH_NESTING);

if (swsusp_resume_device)
goto Check_image;

if (!strlen(resume_file)) {
error = -ENOENT;
goto Unlock;
}

pr_debug("PM: Checking image partition %s\n", resume_file);

/* Check if the device is there */
swsusp_resume_device = name_to_dev_t(resume_file);
if (!swsusp_resume_device) {
if (!strlen(resume_file)) {
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();
/*
* We can't depend on SCSI devices being available after loading
* one of their modules until scsi_complete_async_scans() is
* called and the resume device usually is a SCSI one.
*/
scsi_complete_async_scans();

swsusp_resume_device = name_to_dev_t(resume_file);
pr_debug("PM: Resume from partition %s\n", resume_file);
} else {
pr_debug("PM: Resume from partition %d:%d\n",
MAJOR(swsusp_resume_device),
MINOR(swsusp_resume_device));
if (!swsusp_resume_device) {
error = -ENODEV;
goto Unlock;
}
}

if (noresume) {
/**
* FIXME: If noresume is specified, we need to find the
* partition and reset it back to normal swap space.
*/
mutex_unlock(&pm_mutex);
return 0;
}
Check_image:
pr_debug("PM: Resume from partition %d:%d\n",
MAJOR(swsusp_resume_device), MINOR(swsusp_resume_device));

pr_debug("PM: Checking hibernation image.\n");
error = swsusp_check();
Expand Down

0 comments on commit 81041a1

Please sign in to comment.