Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b1457bcc3a00a0446c7f6e2f22fd24b6d8d0a309
Commit:     b1457bcc3a00a0446c7f6e2f22fd24b6d8d0a309
Parent:     10a1803d667e209914eaada9b95525252f23ec78
Author:     Rafael J. Wysocki <[EMAIL PROTECTED]>
AuthorDate: Thu Jul 19 01:47:31 2007 -0700
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Thu Jul 19 10:04:42 2007 -0700

    Hibernation: prepare to enter the low power state
    
    During hibernation we call hibernation_ops->prepare() before creating the 
image,
    but then, before saving it, we cancel the power transition by calling
    hibernation_ops->finish().  Thus prior to calling hibernation_ops->enter() 
we
    should let the platform firmware know that we're going to enter the low 
power
    state after all.
    
    Signed-off-by: Rafael J. Wysocki <[EMAIL PROTECTED]>
    Cc: Gautham R Shenoy <[EMAIL PROTECTED]>
    Cc: Pavel Machek <[EMAIL PROTECTED]>
    Cc: Nigel Cunningham <[EMAIL PROTECTED]>
    Cc: Oleg Nesterov <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 kernel/power/disk.c |   15 +++++++++++++--
 1 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/kernel/power/disk.c b/kernel/power/disk.c
index 77ac605..885c653 100644
--- a/kernel/power/disk.c
+++ b/kernel/power/disk.c
@@ -205,12 +205,23 @@ int hibernation_restore(int platform_mode)
 
 int hibernation_platform_enter(void)
 {
+       int error;
+
        if (hibernation_ops) {
                kernel_shutdown_prepare(SYSTEM_SUSPEND_DISK);
-               return hibernation_ops->enter();
+               /*
+                * We have cancelled the power transition by running
+                * hibernation_ops->finish() before saving the image, so we
+                * should let the firmware know that we're going to enter the
+                * sleep state after all
+                */
+               error = hibernation_ops->prepare();
+               if (!error)
+                       error = hibernation_ops->enter();
        } else {
-               return -ENOSYS;
+               error = -ENOSYS;
        }
+       return error;
 }
 
 /**
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to