summaryrefslogtreecommitdiff
path: root/drivers/acpi/sleep/main.c
diff options
context:
space:
mode:
authorRafael J. Wysocki <rjw@sisk.pl>2008-01-08 02:05:21 +0300
committerLen Brown <len.brown@intel.com>2008-02-02 02:30:56 +0300
commitc95d47a868f35cd47643d116a3c680cdaa954df8 (patch)
tree36e3b820c8bb0c1c962029ce5a28c6e3251443a9 /drivers/acpi/sleep/main.c
parentc697eecebc6cfc0b393afea3c4ff1a5041526ad1 (diff)
downloadlinux-c95d47a868f35cd47643d116a3c680cdaa954df8.tar.xz
ACPI: Separate invocations of _GTS and _BFS from _PTS and _WAK
The execution of ACPI global control methods _GTS and _BFS is currently tied to the preparation to enter a sleep state and to the leaving of the sleep state, respectively. However, these functions are called before disabling the nonboot CPUs and after enabling them, respectively (in fact, on ACPI 1.0x systems the first of them ought to be called before suspending devices), while according to the ACPI specification, _GTS is to be executed right prior to entering the system sleep state and _BFS is to be executed right after the platfor firmware has returned control to the OS on wake up. Move the execution of _GTS and _BFS to the right places. Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Acked-by: Pavel Machek <pavel@suse.cz> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/sleep/main.c')
-rw-r--r--drivers/acpi/sleep/main.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/acpi/sleep/main.c b/drivers/acpi/sleep/main.c
index e2e4e617952b..fdd8139b3f98 100644
--- a/drivers/acpi/sleep/main.c
+++ b/drivers/acpi/sleep/main.c
@@ -139,6 +139,9 @@ static int acpi_pm_enter(suspend_state_t pm_state)
break;
}
+ /* Reprogram control registers and execute _BFS */
+ acpi_leave_sleep_state_prep(acpi_state);
+
/* ACPI 3.0 specs (P62) says that it's the responsabilty
* of the OSPM to clear the status bit [ implying that the
* POWER_BUTTON event should not reach userspace ]
@@ -272,6 +275,8 @@ static int acpi_hibernation_enter(void)
acpi_enable_wakeup_device(ACPI_STATE_S4);
/* This shouldn't return. If it returns, we have a problem */
status = acpi_enter_sleep_state(ACPI_STATE_S4);
+ /* Reprogram control registers and execute _BFS */
+ acpi_leave_sleep_state_prep(ACPI_STATE_S4);
local_irq_restore(flags);
return ACPI_SUCCESS(status) ? 0 : -EFAULT;
@@ -284,6 +289,8 @@ static void acpi_hibernation_leave(void)
* enable it here.
*/
acpi_enable();
+ /* Reprogram control registers and execute _BFS */
+ acpi_leave_sleep_state_prep(ACPI_STATE_S4);
}
static void acpi_hibernation_finish(void)