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

ACPICA: Events: Update GPE handler removal, match behavior of handler install.

The originally_enabled check is not paired between
acpi_install_gpe_handler() and acpi_remove_gpe_handler().

In ACPICA upstream, there is code to protect original enabled state for
ACPI_GPE_DISPATCH_NOTIFY and this commit fixes an issue for this feature.

Link: https://github.com/acpica/acpica/commit/967f314c
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

authored by

Lv Zheng and committed by
Rafael J. Wysocki
1809919a 437b7512

+5 -3
+5 -3
drivers/acpi/acpica/evxface.c
··· 793 793 * automatically during initialization, in which case it has to be 794 794 * disabled now to avoid spurious execution of the handler. 795 795 */ 796 - if ((handler->original_flags & ACPI_GPE_DISPATCH_METHOD) 797 - && gpe_event_info->runtime_count) { 796 + if (((handler->original_flags & ACPI_GPE_DISPATCH_METHOD) || 797 + (handler->original_flags & ACPI_GPE_DISPATCH_NOTIFY)) && 798 + gpe_event_info->runtime_count) { 798 799 handler->originally_enabled = TRUE; 799 800 (void)acpi_ev_remove_gpe_reference(gpe_event_info); 800 801 ··· 909 908 * enabled, it should be enabled at this point to restore the 910 909 * post-initialization configuration. 911 910 */ 912 - if ((handler->original_flags & ACPI_GPE_DISPATCH_METHOD) && 911 + if (((handler->original_flags & ACPI_GPE_DISPATCH_METHOD) || 912 + (handler->original_flags & ACPI_GPE_DISPATCH_NOTIFY)) && 913 913 handler->originally_enabled) { 914 914 (void)acpi_ev_add_gpe_reference(gpe_event_info); 915 915 }