提交 979f11b0 编写于 作者: R Rafael J. Wysocki

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: NRafael J. Wysocki <rjw@sisk.pl>
上级 7a63f08b
...@@ -244,17 +244,10 @@ static int acpi_suspend_enter(suspend_state_t pm_state) ...@@ -244,17 +244,10 @@ static int acpi_suspend_enter(suspend_state_t pm_state)
{ {
acpi_status status = AE_OK; acpi_status status = AE_OK;
u32 acpi_state = acpi_target_sleep_state; u32 acpi_state = acpi_target_sleep_state;
int error;
ACPI_FLUSH_CPU_CACHE(); 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) { switch (acpi_state) {
case ACPI_STATE_S1: case ACPI_STATE_S1:
barrier(); barrier();
...@@ -262,6 +255,9 @@ static int acpi_suspend_enter(suspend_state_t pm_state) ...@@ -262,6 +255,9 @@ static int acpi_suspend_enter(suspend_state_t pm_state)
break; break;
case ACPI_STATE_S3: case ACPI_STATE_S3:
error = acpi_save_state_mem();
if (error)
return error;
do_suspend_lowlevel(); do_suspend_lowlevel();
pr_info(PREFIX "Low-level resume complete\n"); pr_info(PREFIX "Low-level resume complete\n");
break; break;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册