Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ACPI: clear GPE earily in resume to avoid warning

Wakeup GPE hasn't a handler. If system is waked up by such GPE like a
USB hotplug, I saw a lot of error reporting the GPE hasn't handler.
acpi_leave_sleep_state will clear the GPE but it's too late, we should
do it before interrupt is re-enabled.

Signed-off-by: Shaohua Li <shaohua.li@intel.com>
Acked-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Len Brown <len.brown@intel.com>

authored by

Shaohua Li and committed by
Len Brown
a3627f67 f4cb5700

+7
+7
drivers/acpi/sleep/main.c
··· 146 146 if (ACPI_SUCCESS(status) && (acpi_state == ACPI_STATE_S3)) 147 147 acpi_clear_event(ACPI_EVENT_POWER_BUTTON); 148 148 149 + /* 150 + * Disable and clear GPE status before interrupt is enabled. Some GPEs 151 + * (like wakeup GPE) haven't handler, this can avoid such GPE misfire. 152 + * acpi_leave_sleep_state will reenable specific GPEs later 153 + */ 154 + acpi_hw_disable_all_gpes(); 155 + 149 156 local_irq_restore(flags); 150 157 printk(KERN_DEBUG "Back to C!\n"); 151 158