summaryrefslogtreecommitdiff
path: root/source/components/hardware/hwsleep.c
diff options
context:
space:
mode:
Diffstat (limited to 'source/components/hardware/hwsleep.c')
-rw-r--r--source/components/hardware/hwsleep.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/source/components/hardware/hwsleep.c b/source/components/hardware/hwsleep.c
index fe111872cec0..7e435acecba0 100644
--- a/source/components/hardware/hwsleep.c
+++ b/source/components/hardware/hwsleep.c
@@ -198,17 +198,28 @@ AcpiHwLegacySleep (
return_ACPI_STATUS (Status);
}
- /*
- * 1) Disable all GPEs
- * 2) Enable all wakeup GPEs
- */
+ /* Disable all GPEs */
+
Status = AcpiHwDisableAllGpes ();
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
}
+ /*
+ * If the target sleep state is S5, clear all GPEs and fixed events too
+ */
+ if (SleepState == ACPI_STATE_S5)
+ {
+ Status = AcpiHwClearAcpiStatus();
+ if (ACPI_FAILURE (Status))
+ {
+ return_ACPI_STATUS (Status);
+ }
+ }
AcpiGbl_SystemAwakeAndRunning = FALSE;
+ /* Enable all wakeup GPEs */
+
Status = AcpiHwEnableAllWakeupGpes ();
if (ACPI_FAILURE (Status))
{