Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 267085
b: refs/heads/master
c: 6f8d702
h: refs/heads/master
i:
  267083: d5102c5
v: v3
  • Loading branch information
Barry Song authored and Rafael J. Wysocki committed Oct 16, 2011
1 parent e72319b commit 4909cb6
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 21e82808fc465b66fedaac0f4e885cafb304e843
refs/heads/master: 6f8d7022a842809aeb24db1d15669198ef02c131
4 changes: 4 additions & 0 deletions trunk/Documentation/kernel-parameters.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2240,6 +2240,10 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
in <PAGE_SIZE> units (needed only for swap files).
See Documentation/power/swsusp-and-swap-files.txt

resumewait [HIBERNATION] Wait (indefinitely) for resume device to show up.
Useful for devices that are detected asynchronously
(e.g. USB and MMC devices).

hibernate= [HIBERNATION]
noresume Don't check if there's a hibernation image
present during boot.
Expand Down
16 changes: 16 additions & 0 deletions trunk/kernel/power/hibernate.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include <linux/reboot.h>
#include <linux/string.h>
#include <linux/device.h>
#include <linux/async.h>
#include <linux/kmod.h>
#include <linux/delay.h>
#include <linux/fs.h>
Expand All @@ -31,6 +32,7 @@

static int nocompress = 0;
static int noresume = 0;
static int resume_wait = 0;
static char resume_file[256] = CONFIG_PM_STD_PARTITION;
dev_t swsusp_resume_device;
sector_t swsusp_resume_block;
Expand Down Expand Up @@ -736,6 +738,13 @@ static int software_resume(void)
* to wait for this to finish.
*/
wait_for_device_probe();

if (resume_wait) {
while ((swsusp_resume_device = name_to_dev_t(resume_file)) == 0)
msleep(10);
async_synchronize_full();
}

/*
* We can't depend on SCSI devices being available after loading
* one of their modules until scsi_complete_async_scans() is
Expand Down Expand Up @@ -1064,7 +1073,14 @@ static int __init noresume_setup(char *str)
return 1;
}

static int __init resumewait_setup(char *str)
{
resume_wait = 1;
return 1;
}

__setup("noresume", noresume_setup);
__setup("resume_offset=", resume_offset_setup);
__setup("resume=", resume_setup);
__setup("hibernate=", hibernate_setup);
__setup("resumewait", resumewait_setup);

0 comments on commit 4909cb6

Please sign in to comment.