Commit:     52ade9b3b97fd3bea42842a056fe0786c28d0555
Parent:     7b104bcb8e460e45a1aebe3da9b86aacdb4cab12
Author:     Linus Torvalds <[EMAIL PROTECTED]>
AuthorDate: Wed May 16 15:28:14 2007 -0700
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Wed May 16 15:33:19 2007 -0700

    Fix ACPI suspend / device suspend ordering problem
    In commit e3c7db621bed4afb8e231cb005057f2feb5db557 we fixed the resume
    ordering, so that the ACPI low-level resume code was called before the
    actual driver resume was called. However, that broke the nesting logic
    of suspend and resume, and we continued to suspend the devices _after_
    we the ACPI device suspend code was called.
    That resulted in us saving PCI state for devices that had already been
    changed by ACPI, and in some cases disabled entirely (causing the PCI
    save_state to be all-ones).  Which in turn caused the wrong state to be
    written back on resume.
    This moves the ACPI device suspend to after the device model per-device
    suspend() calls. This fixes the bogus state save.
    Thanks to Lukáš Hejtmánek for testing.
    Acked-by: Lukas Hejtmanek <[EMAIL PROTECTED]>
    Acked-by: Rafael J. Wysocki <[EMAIL PROTECTED]>
    Cc: Len Brown <[EMAIL PROTECTED]>
    Cc: Pavel Machek <[EMAIL PROTECTED]>
    Cc: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
 kernel/power/main.c |   15 ++++++++-------
 1 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/kernel/power/main.c b/kernel/power/main.c
index 40d56a3..b98b80c 100644
--- a/kernel/power/main.c
+++ b/kernel/power/main.c
@@ -97,25 +97,26 @@ static int suspend_prepare(suspend_state_t state)
-       if (pm_ops->prepare) {
-               if ((error = pm_ops->prepare(state)))
-                       goto Thaw;
-       }
        error = device_suspend(PMSG_SUSPEND);
        if (error) {
                printk(KERN_ERR "Some devices failed to suspend\n");
-               goto Resume_devices;
+               goto Resume_console;
+       if (pm_ops->prepare) {
+               if ((error = pm_ops->prepare(state)))
+                       goto Resume_devices;
+       }
        error = disable_nonboot_cpus();
        if (!error)
                return 0;
- Resume_devices:
+ Resume_devices:
+ Resume_console:
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

Reply via email to