* [PATCH] Power Hibernate: (bugfix) when failed, "in_suspend" should be reset.
@ 2010-11-26 9:11 MyungJoo Ham
2010-11-26 22:08 ` Rafael J. Wysocki
0 siblings, 1 reply; 3+ messages in thread
From: MyungJoo Ham @ 2010-11-26 9:11 UTC (permalink / raw)
To: linux-pm; +Cc: Len Brown, kyungmin.park, myungjoo.ham, Andrew Morton
When hibernation failed due to an error in swsusp_write() called by
hibernate(), it skips calling "power_down()" and returns. When
hibernate() is called again (probably after fixing up so that
swsusp_write() wouldn't fail again), before "in_suspend = 1" of
create_image is called, in_suspend should be 0. However, because
hibernate() did not reset "in_suspend" after a failure, it's already 1.
This patch fixes such inconsistency of "in_suspend" value.
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
kernel/power/hibernate.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c
index e6c498d..e27bf22 100644
--- a/kernel/power/hibernate.c
+++ b/kernel/power/hibernate.c
@@ -643,6 +643,7 @@ int hibernate(void)
swsusp_free();
if (!error)
power_down();
+ in_suspend = 0;
} else {
pr_debug("PM: Image restored successfully.\n");
}
--
1.7.0.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] Power Hibernate: (bugfix) when failed, "in_suspend" should be reset.
2010-11-26 9:11 [PATCH] Power Hibernate: (bugfix) when failed, "in_suspend" should be reset MyungJoo Ham
@ 2010-11-26 22:08 ` Rafael J. Wysocki
0 siblings, 0 replies; 3+ messages in thread
From: Rafael J. Wysocki @ 2010-11-26 22:08 UTC (permalink / raw)
To: MyungJoo Ham
Cc: Len Brown, kyungmin.park, myungjoo.ham, linux-pm, Andrew Morton
On Friday, November 26, 2010, MyungJoo Ham wrote:
> When hibernation failed due to an error in swsusp_write() called by
> hibernate(), it skips calling "power_down()" and returns. When
> hibernate() is called again (probably after fixing up so that
> swsusp_write() wouldn't fail again), before "in_suspend = 1" of
> create_image is called, in_suspend should be 0. However, because
> hibernate() did not reset "in_suspend" after a failure, it's already 1.
>
> This patch fixes such inconsistency of "in_suspend" value.
Applied to suspend-2.6/linux-next.
Thanks,
Rafael
> Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
> ---
> kernel/power/hibernate.c | 1 +
> 1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c
> index e6c498d..e27bf22 100644
> --- a/kernel/power/hibernate.c
> +++ b/kernel/power/hibernate.c
> @@ -643,6 +643,7 @@ int hibernate(void)
> swsusp_free();
> if (!error)
> power_down();
> + in_suspend = 0;
> } else {
> pr_debug("PM: Image restored successfully.\n");
> }
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Power Hibernate: (bugfix) when failed, "in_suspend" should be reset.
@ 2011-01-02 9:10 Pavel Machek
0 siblings, 0 replies; 3+ messages in thread
From: Pavel Machek @ 2011-01-02 9:10 UTC (permalink / raw)
To: MyungJoo Ham
Cc: Len Brown, kyungmin.park, myungjoo.ham, linux-pm, Andrew Morton
> When hibernation failed due to an error in swsusp_write() called by
> hibernate(), it skips calling "power_down()" and returns. When
> hibernate() is called again (probably after fixing up so that
> swsusp_write() wouldn't fail again), before "in_suspend = 1" of
> create_image is called, in_suspend should be 0. However, because
> hibernate() did not reset "in_suspend" after a failure, it's already 1.
>
> This patch fixes such inconsistency of "in_suspend" value.
Ack.
> Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
> ---
> kernel/power/hibernate.c | 1 +
> 1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c
> index e6c498d..e27bf22 100644
> --- a/kernel/power/hibernate.c
> +++ b/kernel/power/hibernate.c
> @@ -643,6 +643,7 @@ int hibernate(void)
> swsusp_free();
> if (!error)
> power_down();
> + in_suspend = 0;
> } else {
> pr_debug("PM: Image restored successfully.\n");
> }
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-01-02 9:10 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-26 9:11 [PATCH] Power Hibernate: (bugfix) when failed, "in_suspend" should be reset MyungJoo Ham
2010-11-26 22:08 ` Rafael J. Wysocki
2011-01-02 9:10 Pavel Machek
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.