diff options
-rw-r--r-- | Documentation/kernel-parameters.txt | 4 | ||||
-rw-r--r-- | kernel/power/hibernate.c | 16 |
2 files changed, 20 insertions, 0 deletions
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt index 854ed5ca7e3f..88a7b197a4eb 100644 --- a/Documentation/kernel-parameters.txt +++ b/Documentation/kernel-parameters.txt | |||
@@ -2240,6 +2240,10 @@ bytes respectively. Such letter suffixes can also be entirely omitted. | |||
2240 | in <PAGE_SIZE> units (needed only for swap files). | 2240 | in <PAGE_SIZE> units (needed only for swap files). |
2241 | See Documentation/power/swsusp-and-swap-files.txt | 2241 | See Documentation/power/swsusp-and-swap-files.txt |
2242 | 2242 | ||
2243 | resumewait [HIBERNATION] Wait (indefinitely) for resume device to show up. | ||
2244 | Useful for devices that are detected asynchronously | ||
2245 | (e.g. USB and MMC devices). | ||
2246 | |||
2243 | hibernate= [HIBERNATION] | 2247 | hibernate= [HIBERNATION] |
2244 | noresume Don't check if there's a hibernation image | 2248 | noresume Don't check if there's a hibernation image |
2245 | present during boot. | 2249 | present during boot. |
diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c index 7f44e5c26971..0f8785080cde 100644 --- a/kernel/power/hibernate.c +++ b/kernel/power/hibernate.c | |||
@@ -14,6 +14,7 @@ | |||
14 | #include <linux/reboot.h> | 14 | #include <linux/reboot.h> |
15 | #include <linux/string.h> | 15 | #include <linux/string.h> |
16 | #include <linux/device.h> | 16 | #include <linux/device.h> |
17 | #include <linux/async.h> | ||
17 | #include <linux/kmod.h> | 18 | #include <linux/kmod.h> |
18 | #include <linux/delay.h> | 19 | #include <linux/delay.h> |
19 | #include <linux/fs.h> | 20 | #include <linux/fs.h> |
@@ -31,6 +32,7 @@ | |||
31 | 32 | ||
32 | static int nocompress = 0; | 33 | static int nocompress = 0; |
33 | static int noresume = 0; | 34 | static int noresume = 0; |
35 | static int resume_wait = 0; | ||
34 | static char resume_file[256] = CONFIG_PM_STD_PARTITION; | 36 | static char resume_file[256] = CONFIG_PM_STD_PARTITION; |
35 | dev_t swsusp_resume_device; | 37 | dev_t swsusp_resume_device; |
36 | sector_t swsusp_resume_block; | 38 | sector_t swsusp_resume_block; |
@@ -736,6 +738,13 @@ static int software_resume(void) | |||
736 | * to wait for this to finish. | 738 | * to wait for this to finish. |
737 | */ | 739 | */ |
738 | wait_for_device_probe(); | 740 | wait_for_device_probe(); |
741 | |||
742 | if (resume_wait) { | ||
743 | while ((swsusp_resume_device = name_to_dev_t(resume_file)) == 0) | ||
744 | msleep(10); | ||
745 | async_synchronize_full(); | ||
746 | } | ||
747 | |||
739 | /* | 748 | /* |
740 | * We can't depend on SCSI devices being available after loading | 749 | * We can't depend on SCSI devices being available after loading |
741 | * one of their modules until scsi_complete_async_scans() is | 750 | * one of their modules until scsi_complete_async_scans() is |
@@ -1064,7 +1073,14 @@ static int __init noresume_setup(char *str) | |||
1064 | return 1; | 1073 | return 1; |
1065 | } | 1074 | } |
1066 | 1075 | ||
1076 | static int __init resumewait_setup(char *str) | ||
1077 | { | ||
1078 | resume_wait = 1; | ||
1079 | return 1; | ||
1080 | } | ||
1081 | |||
1067 | __setup("noresume", noresume_setup); | 1082 | __setup("noresume", noresume_setup); |
1068 | __setup("resume_offset=", resume_offset_setup); | 1083 | __setup("resume_offset=", resume_offset_setup); |
1069 | __setup("resume=", resume_setup); | 1084 | __setup("resume=", resume_setup); |
1070 | __setup("hibernate=", hibernate_setup); | 1085 | __setup("hibernate=", hibernate_setup); |
1086 | __setup("resumewait", resumewait_setup); | ||