diff options
Diffstat (limited to 'drivers/acpi/acpica/evxface.c')
-rw-r--r-- | drivers/acpi/acpica/evxface.c | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/drivers/acpi/acpica/evxface.c b/drivers/acpi/acpica/evxface.c index 11e5803b8b41..55a58f3ec8df 100644 --- a/drivers/acpi/acpica/evxface.c +++ b/drivers/acpi/acpica/evxface.c | |||
@@ -786,18 +786,26 @@ acpi_install_gpe_handler(acpi_handle gpe_device, | |||
786 | handler->method_node = gpe_event_info->dispatch.method_node; | 786 | handler->method_node = gpe_event_info->dispatch.method_node; |
787 | handler->original_flags = (u8)(gpe_event_info->flags & | 787 | handler->original_flags = (u8)(gpe_event_info->flags & |
788 | (ACPI_GPE_XRUPT_TYPE_MASK | | 788 | (ACPI_GPE_XRUPT_TYPE_MASK | |
789 | ACPI_GPE_DISPATCH_MASK)); | 789 | ACPI_GPE_DISPATCH_MASK)); |
790 | 790 | ||
791 | /* | 791 | /* |
792 | * If the GPE is associated with a method, it may have been enabled | 792 | * If the GPE is associated with a method, it may have been enabled |
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 | 796 | if (((handler->original_flags & ACPI_GPE_DISPATCH_METHOD) || | |
797 | if ((handler->original_flags & ACPI_GPE_DISPATCH_METHOD) | 797 | (handler->original_flags & ACPI_GPE_DISPATCH_NOTIFY)) && |
798 | && gpe_event_info->runtime_count) { | 798 | gpe_event_info->runtime_count) { |
799 | handler->originally_enabled = 1; | 799 | handler->originally_enabled = TRUE; |
800 | (void)acpi_ev_remove_gpe_reference(gpe_event_info); | 800 | (void)acpi_ev_remove_gpe_reference(gpe_event_info); |
801 | |||
802 | /* Sanity check of original type against new type */ | ||
803 | |||
804 | if (type != | ||
805 | (u32)(gpe_event_info->flags & ACPI_GPE_XRUPT_TYPE_MASK)) { | ||
806 | ACPI_WARNING((AE_INFO, | ||
807 | "GPE type mismatch (level/edge)")); | ||
808 | } | ||
801 | } | 809 | } |
802 | 810 | ||
803 | /* Install the handler */ | 811 | /* Install the handler */ |
@@ -808,7 +816,7 @@ acpi_install_gpe_handler(acpi_handle gpe_device, | |||
808 | 816 | ||
809 | gpe_event_info->flags &= | 817 | gpe_event_info->flags &= |
810 | ~(ACPI_GPE_XRUPT_TYPE_MASK | ACPI_GPE_DISPATCH_MASK); | 818 | ~(ACPI_GPE_XRUPT_TYPE_MASK | ACPI_GPE_DISPATCH_MASK); |
811 | gpe_event_info->flags |= (u8) (type | ACPI_GPE_DISPATCH_HANDLER); | 819 | gpe_event_info->flags |= (u8)(type | ACPI_GPE_DISPATCH_HANDLER); |
812 | 820 | ||
813 | acpi_os_release_lock(acpi_gbl_gpe_lock, flags); | 821 | acpi_os_release_lock(acpi_gbl_gpe_lock, flags); |
814 | 822 | ||
@@ -893,7 +901,7 @@ acpi_remove_gpe_handler(acpi_handle gpe_device, | |||
893 | 901 | ||
894 | gpe_event_info->dispatch.method_node = handler->method_node; | 902 | gpe_event_info->dispatch.method_node = handler->method_node; |
895 | gpe_event_info->flags &= | 903 | gpe_event_info->flags &= |
896 | ~(ACPI_GPE_XRUPT_TYPE_MASK | ACPI_GPE_DISPATCH_MASK); | 904 | ~(ACPI_GPE_XRUPT_TYPE_MASK | ACPI_GPE_DISPATCH_MASK); |
897 | gpe_event_info->flags |= handler->original_flags; | 905 | gpe_event_info->flags |= handler->original_flags; |
898 | 906 | ||
899 | /* | 907 | /* |
@@ -901,7 +909,8 @@ acpi_remove_gpe_handler(acpi_handle gpe_device, | |||
901 | * enabled, it should be enabled at this point to restore the | 909 | * enabled, it should be enabled at this point to restore the |
902 | * post-initialization configuration. | 910 | * post-initialization configuration. |
903 | */ | 911 | */ |
904 | 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)) && | ||
905 | handler->originally_enabled) { | 914 | handler->originally_enabled) { |
906 | (void)acpi_ev_add_gpe_reference(gpe_event_info); | 915 | (void)acpi_ev_add_gpe_reference(gpe_event_info); |
907 | } | 916 | } |
@@ -946,7 +955,7 @@ ACPI_EXPORT_SYMBOL(acpi_remove_gpe_handler) | |||
946 | * handle is returned. | 955 | * handle is returned. |
947 | * | 956 | * |
948 | ******************************************************************************/ | 957 | ******************************************************************************/ |
949 | acpi_status acpi_acquire_global_lock(u16 timeout, u32 * handle) | 958 | acpi_status acpi_acquire_global_lock(u16 timeout, u32 *handle) |
950 | { | 959 | { |
951 | acpi_status status; | 960 | acpi_status status; |
952 | 961 | ||