Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=10a1803d667e209914eaada9b95525252f23ec78
Commit:     10a1803d667e209914eaada9b95525252f23ec78
Parent:     a634cc10164d1c229fbeca33923e6a0ed939e894
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

    swsusp: fix hibernation code ordering
    
    Change the code ordering so that hibernation_ops->prepare() is called after
    device_suspend().  This is needed so that we don't violate the ACPI
    specification, which states that the _PTS and _GTS system-control methods,
    executed from acpi_sleep_prepare(), ought to be called after devices have 
been
    put in low power states.
    
    The "Finish" label in hibernation_restore() is moved, because 
device_suspend()
    resumes devices if the suspending of them fails and the restore code 
ordering
    should reflect the hibernation code ordering.
    
    Signed-off-by: Rafael J. Wysocki <[EMAIL PROTECTED]>
    Acked-by: Pavel Machek <[EMAIL PROTECTED]>
    Cc: Nigel Cunningham <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 kernel/power/disk.c |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/kernel/power/disk.c b/kernel/power/disk.c
index fa3b43b..77ac605 100644
--- a/kernel/power/disk.c
+++ b/kernel/power/disk.c
@@ -133,15 +133,15 @@ int hibernation_snapshot(int platform_mode)
        /* Free memory before shutting down devices. */
        error = swsusp_shrink_memory();
        if (error)
-               goto Finish;
-
-       error = platform_prepare(platform_mode);
-       if (error)
-               goto Finish;
+               return error;
 
        suspend_console();
        error = device_suspend(PMSG_FREEZE);
        if (error)
+               goto Resume_console;
+
+       error = platform_prepare(platform_mode);
+       if (error)
                goto Resume_devices;
 
        error = disable_nonboot_cpus();
@@ -159,8 +159,8 @@ int hibernation_snapshot(int platform_mode)
  Resume_devices:
        platform_finish(platform_mode);
        device_resume();
+ Resume_console:
        resume_console();
- Finish:
        return error;
 }
 
@@ -191,8 +191,8 @@ int hibernation_restore(int platform_mode)
                enable_nonboot_cpus();
        }
        platform_restore_cleanup(platform_mode);
- Finish:
        device_resume();
+ Finish:
        resume_console();
        pm_restore_console();
        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