diff options
author | Lv Zheng <lv.zheng@intel.com> | 2014-10-09 22:39:51 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2014-10-20 18:39:40 -0400 |
commit | 1809919a309dc8c8faad3c048bfda9a9f3fa0443 (patch) | |
tree | 2d3e130ec7d48ddafaf3d01cf8c6a809928af649 /drivers/acpi | |
parent | 437b75123ca5ee36897bfcd1272e96109bed3ea1 (diff) |
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>
Diffstat (limited to 'drivers/acpi')
-rw-r--r-- | drivers/acpi/acpica/evxface.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/acpi/acpica/evxface.c b/drivers/acpi/acpica/evxface.c index 79b6ed204f44..55a58f3ec8df 100644 --- a/drivers/acpi/acpica/evxface.c +++ b/drivers/acpi/acpica/evxface.c | |||
@@ -793,8 +793,9 @@ acpi_install_gpe_handler(acpi_handle gpe_device, | |||
793 | * automatically during initialization, in which case it has to be | 793 | * automatically during initialization, in which case it has to be |
794 | * disabled now to avoid spurious execution of the handler. | 794 | * disabled now to avoid spurious execution of the handler. |
795 | */ | 795 | */ |
796 | if ((handler->original_flags & ACPI_GPE_DISPATCH_METHOD) | 796 | if (((handler->original_flags & ACPI_GPE_DISPATCH_METHOD) || |
797 | && gpe_event_info->runtime_count) { | 797 | (handler->original_flags & ACPI_GPE_DISPATCH_NOTIFY)) && |
798 | gpe_event_info->runtime_count) { | ||
798 | handler->originally_enabled = TRUE; | 799 | handler->originally_enabled = TRUE; |
799 | (void)acpi_ev_remove_gpe_reference(gpe_event_info); | 800 | (void)acpi_ev_remove_gpe_reference(gpe_event_info); |
800 | 801 | ||
@@ -908,7 +909,8 @@ acpi_remove_gpe_handler(acpi_handle gpe_device, | |||
908 | * enabled, it should be enabled at this point to restore the | 909 | * enabled, it should be enabled at this point to restore the |
909 | * post-initialization configuration. | 910 | * post-initialization configuration. |
910 | */ | 911 | */ |
911 | if ((handler->original_flags & ACPI_GPE_DISPATCH_METHOD) && | 912 | if (((handler->original_flags & ACPI_GPE_DISPATCH_METHOD) || |
913 | (handler->original_flags & ACPI_GPE_DISPATCH_NOTIFY)) && | ||
912 | handler->originally_enabled) { | 914 | handler->originally_enabled) { |
913 | (void)acpi_ev_add_gpe_reference(gpe_event_info); | 915 | (void)acpi_ev_add_gpe_reference(gpe_event_info); |
914 | } | 916 | } |