aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/sleep.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/sleep.c')
-rw-r--r--drivers/acpi/sleep.c28
1 files changed, 5 insertions, 23 deletions
diff --git a/drivers/acpi/sleep.c b/drivers/acpi/sleep.c
index 1850dac8f45c..6c949602cbd1 100644
--- a/drivers/acpi/sleep.c
+++ b/drivers/acpi/sleep.c
@@ -200,8 +200,6 @@ static void acpi_pm_end(void)
200#endif /* CONFIG_ACPI_SLEEP */ 200#endif /* CONFIG_ACPI_SLEEP */
201 201
202#ifdef CONFIG_SUSPEND 202#ifdef CONFIG_SUSPEND
203extern void do_suspend_lowlevel(void);
204
205static u32 acpi_suspend_states[] = { 203static u32 acpi_suspend_states[] = {
206 [PM_SUSPEND_ON] = ACPI_STATE_S0, 204 [PM_SUSPEND_ON] = ACPI_STATE_S0,
207 [PM_SUSPEND_STANDBY] = ACPI_STATE_S1, 205 [PM_SUSPEND_STANDBY] = ACPI_STATE_S1,
@@ -244,20 +242,11 @@ static int acpi_suspend_begin(suspend_state_t pm_state)
244static int acpi_suspend_enter(suspend_state_t pm_state) 242static int acpi_suspend_enter(suspend_state_t pm_state)
245{ 243{
246 acpi_status status = AE_OK; 244 acpi_status status = AE_OK;
247 unsigned long flags = 0;
248 u32 acpi_state = acpi_target_sleep_state; 245 u32 acpi_state = acpi_target_sleep_state;
246 int error;
249 247
250 ACPI_FLUSH_CPU_CACHE(); 248 ACPI_FLUSH_CPU_CACHE();
251 249
252 /* Do arch specific saving of state. */
253 if (acpi_state == ACPI_STATE_S3) {
254 int error = acpi_save_state_mem();
255
256 if (error)
257 return error;
258 }
259
260 local_irq_save(flags);
261 switch (acpi_state) { 250 switch (acpi_state) {
262 case ACPI_STATE_S1: 251 case ACPI_STATE_S1:
263 barrier(); 252 barrier();
@@ -265,7 +254,10 @@ static int acpi_suspend_enter(suspend_state_t pm_state)
265 break; 254 break;
266 255
267 case ACPI_STATE_S3: 256 case ACPI_STATE_S3:
268 do_suspend_lowlevel(); 257 error = acpi_suspend_lowlevel();
258 if (error)
259 return error;
260 pr_info(PREFIX "Low-level resume complete\n");
269 break; 261 break;
270 } 262 }
271 263
@@ -291,13 +283,6 @@ static int acpi_suspend_enter(suspend_state_t pm_state)
291 /* Allow EC transactions to happen. */ 283 /* Allow EC transactions to happen. */
292 acpi_ec_unblock_transactions_early(); 284 acpi_ec_unblock_transactions_early();
293 285
294 local_irq_restore(flags);
295 printk(KERN_DEBUG "Back to C!\n");
296
297 /* restore processor state */
298 if (acpi_state == ACPI_STATE_S3)
299 acpi_restore_state_mem();
300
301 suspend_nvs_restore(); 286 suspend_nvs_restore();
302 287
303 return ACPI_SUCCESS(status) ? 0 : -EFAULT; 288 return ACPI_SUCCESS(status) ? 0 : -EFAULT;
@@ -473,16 +458,13 @@ static int acpi_hibernation_begin(void)
473static int acpi_hibernation_enter(void) 458static int acpi_hibernation_enter(void)
474{ 459{
475 acpi_status status = AE_OK; 460 acpi_status status = AE_OK;
476 unsigned long flags = 0;
477 461
478 ACPI_FLUSH_CPU_CACHE(); 462 ACPI_FLUSH_CPU_CACHE();
479 463
480 local_irq_save(flags);
481 /* This shouldn't return. If it returns, we have a problem */ 464 /* This shouldn't return. If it returns, we have a problem */
482 status = acpi_enter_sleep_state(ACPI_STATE_S4); 465 status = acpi_enter_sleep_state(ACPI_STATE_S4);
483 /* Reprogram control registers and execute _BFS */ 466 /* Reprogram control registers and execute _BFS */
484 acpi_leave_sleep_state_prep(ACPI_STATE_S4); 467 acpi_leave_sleep_state_prep(ACPI_STATE_S4);
485 local_irq_restore(flags);
486 468
487 return ACPI_SUCCESS(status) ? 0 : -EFAULT; 469 return ACPI_SUCCESS(status) ? 0 : -EFAULT;
488} 470}