Commit 983d56eb authored by Pavel Machek's avatar Pavel Machek Committed by Linus Torvalds

[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.
parent c2ad32fc
...@@ -41,5 +41,6 @@ void do_suspend_lowlevel(int resume) ...@@ -41,5 +41,6 @@ void do_suspend_lowlevel(int resume)
return; return;
} }
acpi_sleep_done: acpi_sleep_done:
acpi_restore_register_state();
restore_processor_context(); restore_processor_context();
} }
...@@ -267,25 +267,15 @@ acpi_system_suspend( ...@@ -267,25 +267,15 @@ acpi_system_suspend(
switch (state) switch (state)
{ {
case ACPI_STATE_S1: case ACPI_STATE_S1:
/* do nothing */ barrier();
status = acpi_enter_sleep_state(state);
break; break;
case ACPI_STATE_S2: case ACPI_STATE_S2:
case ACPI_STATE_S3: case ACPI_STATE_S3:
save_processor_context(); do_suspend_lowlevel(0);
/* TODO: this is horribly broken, fix it */
/* TODO: inline this function in acpi_suspend,or something. */
break; break;
} }
barrier();
status = acpi_enter_sleep_state(state);
acpi_sleep_done:
restore_processor_context();
fix_processor_context();
restore_flags(flags); restore_flags(flags);
return status; return status;
...@@ -307,6 +297,8 @@ acpi_suspend ( ...@@ -307,6 +297,8 @@ acpi_suspend (
if (state < ACPI_STATE_S1 || state > ACPI_STATE_S5) if (state < ACPI_STATE_S1 || state > ACPI_STATE_S5)
return AE_ERROR; return AE_ERROR;
freeze_processes(); /* device_suspend needs processes to be stopped */
/* do we have a wakeup address for S2 and S3? */ /* do we have a wakeup address for S2 and S3? */
if (state == ACPI_STATE_S2 || state == ACPI_STATE_S3) { if (state == ACPI_STATE_S2 || state == ACPI_STATE_S3) {
if (!acpi_wakeup_address) if (!acpi_wakeup_address)
...@@ -339,6 +331,7 @@ acpi_suspend ( ...@@ -339,6 +331,7 @@ acpi_suspend (
/* reset firmware waking vector */ /* reset firmware waking vector */
acpi_set_firmware_waking_vector((ACPI_PHYSICAL_ADDRESS) 0); acpi_set_firmware_waking_vector((ACPI_PHYSICAL_ADDRESS) 0);
thaw_processes();
return status; return status;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment