提交 f126f733 编写于 作者: B Barry Song 提交者: Rafael J. Wysocki

PM / Hibernate: Add resumedelay kernel param in addition to resumewait

Patch "PM / Hibernate: Add resumewait param to support MMC-like
devices as resume file" added the resumewait kernel command line
option.  The present patch adds resumedelay so that
resumewait/delay were analogous to rootwait/delay.

[rjw: Modified the subject and changelog slightly.]
Signed-off-by: NBarry Song <baohua.song@csr.com>
Acked-by: NPavel Machek <pavel@ucw.cz>
Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
上级 bf1c138e
...@@ -2240,6 +2240,9 @@ bytes respectively. Such letter suffixes can also be entirely omitted. ...@@ -2240,6 +2240,9 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
in <PAGE_SIZE> units (needed only for swap files). in <PAGE_SIZE> units (needed only for swap files).
See Documentation/power/swsusp-and-swap-files.txt See Documentation/power/swsusp-and-swap-files.txt
resumedelay= [HIBERNATION] Delay (in seconds) to pause before attempting to
read the resume files
resumewait [HIBERNATION] Wait (indefinitely) for resume device to show up. resumewait [HIBERNATION] Wait (indefinitely) for resume device to show up.
Useful for devices that are detected asynchronously Useful for devices that are detected asynchronously
(e.g. USB and MMC devices). (e.g. USB and MMC devices).
......
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
static int nocompress = 0; static int nocompress = 0;
static int noresume = 0; static int noresume = 0;
static int resume_wait = 0; static int resume_wait = 0;
static int resume_delay = 0;
static char resume_file[256] = CONFIG_PM_STD_PARTITION; static char resume_file[256] = CONFIG_PM_STD_PARTITION;
dev_t swsusp_resume_device; dev_t swsusp_resume_device;
sector_t swsusp_resume_block; sector_t swsusp_resume_block;
...@@ -730,6 +731,12 @@ static int software_resume(void) ...@@ -730,6 +731,12 @@ static int software_resume(void)
pr_debug("PM: Checking hibernation image partition %s\n", resume_file); pr_debug("PM: Checking hibernation image partition %s\n", resume_file);
if (resume_delay) {
printk(KERN_INFO "Waiting %dsec before reading resume device...\n",
resume_delay);
ssleep(resume_delay);
}
/* Check if the device is there */ /* Check if the device is there */
swsusp_resume_device = name_to_dev_t(resume_file); swsusp_resume_device = name_to_dev_t(resume_file);
if (!swsusp_resume_device) { if (!swsusp_resume_device) {
...@@ -1079,8 +1086,15 @@ static int __init resumewait_setup(char *str) ...@@ -1079,8 +1086,15 @@ static int __init resumewait_setup(char *str)
return 1; return 1;
} }
static int __init resumedelay_setup(char *str)
{
resume_delay = simple_strtoul(str, NULL, 0);
return 1;
}
__setup("noresume", noresume_setup); __setup("noresume", noresume_setup);
__setup("resume_offset=", resume_offset_setup); __setup("resume_offset=", resume_offset_setup);
__setup("resume=", resume_setup); __setup("resume=", resume_setup);
__setup("hibernate=", hibernate_setup); __setup("hibernate=", hibernate_setup);
__setup("resumewait", resumewait_setup); __setup("resumewait", resumewait_setup);
__setup("resumedelay=", resumedelay_setup);
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册