* [PATCH] PM: HIBERNATION: add resume_delay kernel param as well as resume_delay
@ 2011-10-10 5:44 Barry Song
2011-10-10 6:26 ` Borislav Petkov
2011-10-10 16:54 ` Pavel Machek
0 siblings, 2 replies; 6+ messages in thread
From: Barry Song @ 2011-10-10 5:44 UTC (permalink / raw)
To: linux-arm-kernel
From: Barry Song <baohua.song@csr.com>
patch "PM: HIBERNATION: add resume_wait param to support MMC-like devices
as resume file" add resume_wait param. this patch adds resume_delay so that
resume_wait/delay has the same model with root_wait/delay.
Signed-off-by: Barry Song <baohua.song@csr.com>
---
Documentation/kernel-parameters.txt | 3 +++
kernel/power/hibernate.c | 14 ++++++++++++++
2 files changed, 17 insertions(+), 0 deletions(-)
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
index 88a7b19..831bde2 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -2240,6 +2240,9 @@ 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
+ resumedelay= [HIBERNATION] Delay (in seconds) to pause before attempting to
+ read the resume files
+
resumewait [HIBERNATION] Wait (indefinitely) for resume device to show up.
Useful for devices that are detected asynchronously
(e.g. USB and MMC devices).
diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c
index b3da53c..f73a00e 100644
--- a/kernel/power/hibernate.c
+++ b/kernel/power/hibernate.c
@@ -33,6 +33,7 @@
static int nocompress = 0;
static int noresume = 0;
static int resume_wait = 0;
+static int resume_delay = 0;
static char resume_file[256] = CONFIG_PM_STD_PARTITION;
dev_t swsusp_resume_device;
sector_t swsusp_resume_block;
@@ -726,6 +727,12 @@ static int software_resume(void)
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 */
swsusp_resume_device = name_to_dev_t(resume_file);
if (!swsusp_resume_device) {
@@ -1075,8 +1082,15 @@ static int __init resumewait_setup(char *str)
return 1;
}
+static int __init resumedelay_setup(char *str)
+{
+ resume_delay = simple_strtoul(str, NULL, 0);
+ return 1;
+}
+
__setup("noresume", noresume_setup);
__setup("resume_offset=", resume_offset_setup);
__setup("resume=", resume_setup);
__setup("hibernate=", hibernate_setup);
__setup("resumewait", resumewait_setup);
+__setup("resumedelay=", resumedelay_setup);
--
1.7.1
Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom
More information can be found at www.csr.com. Follow CSR on Twitter at http://twitter.com/CSR_PLC and read our blog at www.csr.com/blog
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH] PM: HIBERNATION: add resume_delay kernel param as well as resume_delay
2011-10-10 5:44 [PATCH] PM: HIBERNATION: add resume_delay kernel param as well as resume_delay Barry Song
@ 2011-10-10 6:26 ` Borislav Petkov
2011-10-10 6:34 ` Barry Song
2011-10-10 16:54 ` Pavel Machek
1 sibling, 1 reply; 6+ messages in thread
From: Borislav Petkov @ 2011-10-10 6:26 UTC (permalink / raw)
To: linux-arm-kernel
On Sun, Oct 09, 2011 at 10:44:12PM -0700, Barry Song wrote:
> From: Barry Song <baohua.song@csr.com>
>
> patch "PM: HIBERNATION: add resume_wait param to support MMC-like devices
> as resume file" add resume_wait param. this patch adds resume_delay so that
> resume_wait/delay has the same model with root_wait/delay.
>
> Signed-off-by: Barry Song <baohua.song@csr.com>
> ---
> Documentation/kernel-parameters.txt | 3 +++
> kernel/power/hibernate.c | 14 ++++++++++++++
> 2 files changed, 17 insertions(+), 0 deletions(-)
>
> diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
> index 88a7b19..831bde2 100644
> --- a/Documentation/kernel-parameters.txt
> +++ b/Documentation/kernel-parameters.txt
> @@ -2240,6 +2240,9 @@ 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
>
> + resumedelay= [HIBERNATION] Delay (in seconds) to pause before attempting to
> + read the resume files
> +
> resumewait [HIBERNATION] Wait (indefinitely) for resume device to show up.
> Useful for devices that are detected asynchronously
> (e.g. USB and MMC devices).
> diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c
> index b3da53c..f73a00e 100644
> --- a/kernel/power/hibernate.c
> +++ b/kernel/power/hibernate.c
> @@ -33,6 +33,7 @@
> static int nocompress = 0;
> static int noresume = 0;
> static int resume_wait = 0;
> +static int resume_delay = 0;
These static variables get zeroed needlessly and checkpatch actually
warns about that. Maybe fix that up while you're there?
Thanks.
--
Regards/Gruss,
Boris.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH] PM: HIBERNATION: add resume_delay kernel param as well as resume_delay
2011-10-10 6:26 ` Borislav Petkov
@ 2011-10-10 6:34 ` Barry Song
2011-10-10 7:00 ` Borislav Petkov
0 siblings, 1 reply; 6+ messages in thread
From: Barry Song @ 2011-10-10 6:34 UTC (permalink / raw)
To: linux-arm-kernel
2011/10/10 Borislav Petkov <bp@alien8.de>:
> On Sun, Oct 09, 2011 at 10:44:12PM -0700, Barry Song wrote:
>> From: Barry Song <baohua.song@csr.com>
>>
>> patch "PM: HIBERNATION: add resume_wait param to support MMC-like devices
>> as resume file" add resume_wait param. this patch adds resume_delay so that
>> resume_wait/delay has the same model with root_wait/delay.
>>
>> Signed-off-by: Barry Song <baohua.song@csr.com>
>> ---
>> ?Documentation/kernel-parameters.txt | ? ?3 +++
>> ?kernel/power/hibernate.c ? ? ? ? ? ?| ? 14 ++++++++++++++
>> ?2 files changed, 17 insertions(+), 0 deletions(-)
>>
>> diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
>> index 88a7b19..831bde2 100644
>> --- a/Documentation/kernel-parameters.txt
>> +++ b/Documentation/kernel-parameters.txt
>> @@ -2240,6 +2240,9 @@ 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
>>
>> + ? ? resumedelay= ? ?[HIBERNATION] Delay (in seconds) to pause before attempting to
>> + ? ? ? ? ? ? ? ? ? ? read the resume files
>> +
>> ? ? ? resumewait ? ? ?[HIBERNATION] Wait (indefinitely) for resume device to show up.
>> ? ? ? ? ? ? ? ? ? ? ? Useful for devices that are detected asynchronously
>> ? ? ? ? ? ? ? ? ? ? ? (e.g. USB and MMC devices).
>> diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c
>> index b3da53c..f73a00e 100644
>> --- a/kernel/power/hibernate.c
>> +++ b/kernel/power/hibernate.c
>> @@ -33,6 +33,7 @@
>> ?static int nocompress = 0;
>> ?static int noresume = 0;
>> ?static int resume_wait = 0;
>> +static int resume_delay = 0;
>
> These static variables get zeroed needlessly and checkpatch actually
> warns about that. Maybe fix that up while you're there?
yes. right. i initilized it to 0 to keep consistent coding style with
the context because there were other variants doing that.
i'd like to delete all initialization together as a seperate patch. Or
do you want to do that?
>
> Thanks.
>
> --
> Regards/Gruss,
> ? ?Boris.
-barry
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH] PM: HIBERNATION: add resume_delay kernel param as well as resume_delay
2011-10-10 6:34 ` Barry Song
@ 2011-10-10 7:00 ` Borislav Petkov
0 siblings, 0 replies; 6+ messages in thread
From: Borislav Petkov @ 2011-10-10 7:00 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, Oct 10, 2011 at 02:34:45PM +0800, Barry Song wrote:
> >> diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c
> >> index b3da53c..f73a00e 100644
> >> --- a/kernel/power/hibernate.c
> >> +++ b/kernel/power/hibernate.c
> >> @@ -33,6 +33,7 @@
> >> ?static int nocompress = 0;
> >> ?static int noresume = 0;
> >> ?static int resume_wait = 0;
> >> +static int resume_delay = 0;
> >
> > These static variables get zeroed needlessly and checkpatch actually
> > warns about that. Maybe fix that up while you're there?
>
> yes. right. i initilized it to 0 to keep consistent coding style with
> the context because there were other variants doing that.
> i'd like to delete all initialization together as a seperate patch. Or
> do you want to do that?
Nah, you go ahead :-).
Thanks.
--
Regards/Gruss,
Boris.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH] PM: HIBERNATION: add resume_delay kernel param as well as resume_delay
2011-10-10 5:44 [PATCH] PM: HIBERNATION: add resume_delay kernel param as well as resume_delay Barry Song
2011-10-10 6:26 ` Borislav Petkov
@ 2011-10-10 16:54 ` Pavel Machek
2011-10-10 21:46 ` Rafael J. Wysocki
1 sibling, 1 reply; 6+ messages in thread
From: Pavel Machek @ 2011-10-10 16:54 UTC (permalink / raw)
To: linux-arm-kernel
On Sun 2011-10-09 22:44:12, Barry Song wrote:
> From: Barry Song <baohua.song@csr.com>
>
> patch "PM: HIBERNATION: add resume_wait param to support MMC-like devices
> as resume file" add resume_wait param. this patch adds resume_delay so that
> resume_wait/delay has the same model with root_wait/delay.
>
> Signed-off-by: Barry Song <baohua.song@csr.com>
ACK.
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH] PM: HIBERNATION: add resume_delay kernel param as well as resume_delay
2011-10-10 16:54 ` Pavel Machek
@ 2011-10-10 21:46 ` Rafael J. Wysocki
0 siblings, 0 replies; 6+ messages in thread
From: Rafael J. Wysocki @ 2011-10-10 21:46 UTC (permalink / raw)
To: linux-arm-kernel
On Monday, October 10, 2011, Pavel Machek wrote:
> On Sun 2011-10-09 22:44:12, Barry Song wrote:
> > From: Barry Song <baohua.song@csr.com>
> >
> > patch "PM: HIBERNATION: add resume_wait param to support MMC-like devices
> > as resume file" add resume_wait param. this patch adds resume_delay so that
> > resume_wait/delay has the same model with root_wait/delay.
> >
> > Signed-off-by: Barry Song <baohua.song@csr.com>
>
> ACK.
Applied to linux-pm/linux-next.
Thanks,
Rafael
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2011-10-10 21:46 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-10 5:44 [PATCH] PM: HIBERNATION: add resume_delay kernel param as well as resume_delay Barry Song
2011-10-10 6:26 ` Borislav Petkov
2011-10-10 6:34 ` Barry Song
2011-10-10 7:00 ` Borislav Petkov
2011-10-10 16:54 ` Pavel Machek
2011-10-10 21:46 ` Rafael J. Wysocki
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).