summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael J. Wysocki <rjw@sisk.pl>2011-02-08 23:42:09 +0100
committerRafael J. Wysocki <rjw@sisk.pl>2011-02-24 19:58:54 +0100
commit979f11b060c0b35b03b86ae854d6f21a710305d0 (patch)
tree5101d264c9a4cdffc1934cb20cb0be9c485792ed
parent7a63f08b2b904d25e966dd0e15c9af4a13c80b90 (diff)
downloadblackbird-op-linux-979f11b060c0b35b03b86ae854d6f21a710305d0.tar.gz
blackbird-op-linux-979f11b060c0b35b03b86ae854d6f21a710305d0.zip
ACPI / PM: Call acpi_save_state_mem() right before low-level suspend
Since acpi_save_state_mem() is only called by acpi_suspend_enter() if the target sleep state is S3, it's better to call it under the switch (acpi_state), right before do_suspend_lowlevel(). Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-rw-r--r--drivers/acpi/sleep.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/drivers/acpi/sleep.c b/drivers/acpi/sleep.c
index 6bea2fe8434b..2307604064b3 100644
--- a/drivers/acpi/sleep.c
+++ b/drivers/acpi/sleep.c
@@ -244,17 +244,10 @@ static int acpi_suspend_enter(suspend_state_t pm_state)
{
acpi_status status = AE_OK;
u32 acpi_state = acpi_target_sleep_state;
+ int error;
ACPI_FLUSH_CPU_CACHE();
- /* Do arch specific saving of state. */
- if (acpi_state == ACPI_STATE_S3) {
- int error = acpi_save_state_mem();
-
- if (error)
- return error;
- }
-
switch (acpi_state) {
case ACPI_STATE_S1:
barrier();
@@ -262,6 +255,9 @@ static int acpi_suspend_enter(suspend_state_t pm_state)
break;
case ACPI_STATE_S3:
+ error = acpi_save_state_mem();
+ if (error)
+ return error;
do_suspend_lowlevel();
pr_info(PREFIX "Low-level resume complete\n");
break;
OpenPOWER on IntegriCloud