Commit 25bed557 authored by Rafael J. Wysocki's avatar Rafael J. Wysocki Committed by Len Brown

ACPI / Sleep: Rework enabling wakeup devices

There is no reason why acpi_enable_wakeup_device() should be called
with interrupts disabled, because it doesn't access hardware.  Thus
it is possible to move it next to acpi_enable_wakeup_device_prep()
and make the ACPI suspend, hibernate and poweroff code more
straightforward.
Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: default avatarLen Brown <len.brown@intel.com>
parent e96c4b08
...@@ -70,10 +70,11 @@ static int acpi_sleep_prepare(u32 acpi_state) ...@@ -70,10 +70,11 @@ static int acpi_sleep_prepare(u32 acpi_state)
} }
ACPI_FLUSH_CPU_CACHE(); ACPI_FLUSH_CPU_CACHE();
acpi_enable_wakeup_device_prep(acpi_state);
#endif #endif
printk(KERN_INFO PREFIX "Preparing to enter system sleep state S%d\n", printk(KERN_INFO PREFIX "Preparing to enter system sleep state S%d\n",
acpi_state); acpi_state);
acpi_enable_wakeup_device_prep(acpi_state);
acpi_enable_wakeup_device(acpi_state);
acpi_enter_sleep_state_prep(acpi_state); acpi_enter_sleep_state_prep(acpi_state);
return 0; return 0;
} }
...@@ -238,7 +239,6 @@ static int acpi_suspend_enter(suspend_state_t pm_state) ...@@ -238,7 +239,6 @@ static int acpi_suspend_enter(suspend_state_t pm_state)
} }
local_irq_save(flags); local_irq_save(flags);
acpi_enable_wakeup_device(acpi_state);
switch (acpi_state) { switch (acpi_state) {
case ACPI_STATE_S1: case ACPI_STATE_S1:
barrier(); barrier();
...@@ -442,7 +442,6 @@ static int acpi_hibernation_enter(void) ...@@ -442,7 +442,6 @@ static int acpi_hibernation_enter(void)
ACPI_FLUSH_CPU_CACHE(); ACPI_FLUSH_CPU_CACHE();
local_irq_save(flags); local_irq_save(flags);
acpi_enable_wakeup_device(ACPI_STATE_S4);
/* This shouldn't return. If it returns, we have a problem */ /* This shouldn't return. If it returns, we have a problem */
status = acpi_enter_sleep_state(ACPI_STATE_S4); status = acpi_enter_sleep_state(ACPI_STATE_S4);
/* Reprogram control registers and execute _BFS */ /* Reprogram control registers and execute _BFS */
...@@ -696,7 +695,6 @@ static void acpi_power_off(void) ...@@ -696,7 +695,6 @@ static void acpi_power_off(void)
/* acpi_sleep_prepare(ACPI_STATE_S5) should have already been called */ /* acpi_sleep_prepare(ACPI_STATE_S5) should have already been called */
printk(KERN_DEBUG "%s called\n", __func__); printk(KERN_DEBUG "%s called\n", __func__);
local_irq_disable(); local_irq_disable();
acpi_enable_wakeup_device(ACPI_STATE_S5);
acpi_enter_sleep_state(ACPI_STATE_S5); acpi_enter_sleep_state(ACPI_STATE_S5);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment