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