diff options
| author | Pavel Machek <pavel@suse.cz> | 2002-06-03 00:28:09 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@penguin.transmeta.com> | 2002-06-03 00:28:09 -0700 |
| commit | 983d56ebfc07376a49fdad11510dfe5738d8129b (patch) | |
| tree | 8541dc434f7c97abdffbd149d71999629eadee85 | |
| parent | c2ad32fc27cf7c46dd926f6431f568ee2fa64b15 (diff) | |
[PATCH] Re: Fix suspend-to-RAM in 2.5.20
Here's followup patch that makes it work. Notice freeze_processes() --
if you don't do that you risk data corruption.
| -rw-r--r-- | arch/i386/kernel/suspend.c | 1 | ||||
| -rw-r--r-- | drivers/acpi/system.c | 19 |
2 files changed, 7 insertions, 13 deletions
diff --git a/arch/i386/kernel/suspend.c b/arch/i386/kernel/suspend.c index 9302e601be54..07f966251209 100644 --- a/arch/i386/kernel/suspend.c +++ b/arch/i386/kernel/suspend.c @@ -41,5 +41,6 @@ void do_suspend_lowlevel(int resume) return; } acpi_sleep_done: + acpi_restore_register_state(); restore_processor_context(); } diff --git a/drivers/acpi/system.c b/drivers/acpi/system.c index f7cd2fc8635b..93ab11921f29 100644 --- a/drivers/acpi/system.c +++ b/drivers/acpi/system.c @@ -267,25 +267,15 @@ acpi_system_suspend( switch (state) { case ACPI_STATE_S1: - /* do nothing */ + barrier(); + status = acpi_enter_sleep_state(state); break; case ACPI_STATE_S2: case ACPI_STATE_S3: - save_processor_context(); - /* TODO: this is horribly broken, fix it */ - /* TODO: inline this function in acpi_suspend,or something. */ + do_suspend_lowlevel(0); break; } - - barrier(); - status = acpi_enter_sleep_state(state); - -acpi_sleep_done: - - restore_processor_context(); - fix_processor_context(); - restore_flags(flags); return status; @@ -307,6 +297,8 @@ acpi_suspend ( if (state < ACPI_STATE_S1 || state > ACPI_STATE_S5) return AE_ERROR; + freeze_processes(); /* device_suspend needs processes to be stopped */ + /* do we have a wakeup address for S2 and S3? */ if (state == ACPI_STATE_S2 || state == ACPI_STATE_S3) { if (!acpi_wakeup_address) @@ -339,6 +331,7 @@ acpi_suspend ( /* reset firmware waking vector */ acpi_set_firmware_waking_vector((ACPI_PHYSICAL_ADDRESS) 0); + thaw_processes(); return status; } |
