Commit 3c1d2b60 authored by Rafael J. Wysocki's avatar Rafael J. Wysocki Committed by Len Brown

ACPI: Separate disabling of GPEs from _PTS

The preparation to enter an ACPI system sleep state is now tied to
the disabling of GPEs, but the GPEs should not be disabled before
suspending devices.  Since on ACPI 1.0x systems the _PTS global
control method should be executed before suspending devices, we
need to disable GPEs separately.
Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
Acked-by: default avatarPavel Machek <pavel@suse.cz>
Signed-off-by: default avatarLen Brown <len.brown@intel.com>
parent c95d47a8
...@@ -229,10 +229,6 @@ acpi_status acpi_enter_sleep_state_prep(u8 sleep_state) ...@@ -229,10 +229,6 @@ acpi_status acpi_enter_sleep_state_prep(u8 sleep_state)
"While executing method _SST")); "While executing method _SST"));
} }
/* Disable/Clear all GPEs */
status = acpi_hw_disable_all_gpes();
return_ACPI_STATUS(status); return_ACPI_STATUS(status);
} }
......
...@@ -91,10 +91,13 @@ static int acpi_pm_begin(suspend_state_t pm_state) ...@@ -91,10 +91,13 @@ static int acpi_pm_begin(suspend_state_t pm_state)
static int acpi_pm_prepare(void) static int acpi_pm_prepare(void)
{ {
int error = acpi_sleep_prepare(acpi_target_sleep_state); int error;
error = acpi_sleep_prepare(acpi_target_sleep_state);
if (error) if (error)
acpi_target_sleep_state = ACPI_STATE_S0; acpi_target_sleep_state = ACPI_STATE_S0;
else if (!ACPI_SUCCESS(acpi_hw_disable_all_gpes()))
error = -EFAULT;
return error; return error;
} }
...@@ -261,7 +264,16 @@ static int acpi_hibernation_start(void) ...@@ -261,7 +264,16 @@ static int acpi_hibernation_start(void)
static int acpi_hibernation_prepare(void) static int acpi_hibernation_prepare(void)
{ {
return acpi_sleep_prepare(ACPI_STATE_S4); int error;
error = acpi_sleep_prepare(ACPI_STATE_S4);
if (error)
return error;
if (!ACPI_SUCCESS(acpi_hw_disable_all_gpes()))
error = -EFAULT;
return error;
} }
static int acpi_hibernation_enter(void) static int acpi_hibernation_enter(void)
...@@ -426,6 +438,7 @@ static void acpi_power_off_prepare(void) ...@@ -426,6 +438,7 @@ static void acpi_power_off_prepare(void)
{ {
/* Prepare to power off the system */ /* Prepare to power off the system */
acpi_sleep_prepare(ACPI_STATE_S5); acpi_sleep_prepare(ACPI_STATE_S5);
acpi_hw_disable_all_gpes();
} }
static void acpi_power_off(void) static void acpi_power_off(void)
......
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