diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-03-24 11:25:15 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-03-24 11:25:15 -0400 |
commit | 047f61c5d16d617e1df2deea5c5d5fb2a1b41c95 (patch) | |
tree | 75d51e1813664ad54fa680a0ecfb2b756d3d4b0f /drivers/acpi/sleep.c | |
parent | 05061bf678de5d69ebaae2c0705bf106e3000b6e (diff) | |
parent | 3d26678e8009b03f27674c2f9e5b236c2f627b14 (diff) |
Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6
* 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6: (42 commits)
ACPI: minor printk format change in acpi_pad
ACPI: make acpi_pad /sys output more readable
ACPICA: Update version to 20110316
ACPICA: Header support for SLIC table
ACPI: Make sure the FADT is at least rev 2 before using the reset register
ACPI: Bug compatibility for Windows on the ACPI reboot vector
ACPICA: Fix access width for reset vector
ACPI battery: fribble sysfs files from a resume notifier
ACPI button: remove unused procfs I/F
ACPI, APEI, Add PCIe AER error information printing support
PCIe, AER, use pre-generated prefix in error information printing
ACPI, APEI, Add ERST record ID cache
ACPI: Use syscore_ops instead of sysdev class and sysdev
ACPI: Remove the unused EC sysdev class
ACPI: use __cpuinit for the acpi_processor_set_pdc() call tree
ACPI: use __init where possible in processor driver
Thermal_Framework-Fix_crash_during_hwmon_unregister
ACPICA: Update version to 20110211.
ACPICA: Add mechanism to defer _REG methods for some installed handlers
ACPICA: Add support for FunctionalFixedHW in acpi_ut_get_region_name
...
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 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 |
203 | extern void do_suspend_lowlevel(void); | ||
204 | |||
205 | static u32 acpi_suspend_states[] = { | 203 | static 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) | |||
244 | static int acpi_suspend_enter(suspend_state_t pm_state) | 242 | static 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) | |||
473 | static int acpi_hibernation_enter(void) | 458 | static 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 | } |