diff options
Diffstat (limited to 'drivers/acpi/acpica/evxface.c')
-rw-r--r-- | drivers/acpi/acpica/evxface.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/drivers/acpi/acpica/evxface.c b/drivers/acpi/acpica/evxface.c index 14e48add32fa..36af222cac65 100644 --- a/drivers/acpi/acpica/evxface.c +++ b/drivers/acpi/acpica/evxface.c | |||
@@ -726,15 +726,16 @@ acpi_install_gpe_handler(acpi_handle gpe_device, | |||
726 | (ACPI_GPE_XRUPT_TYPE_MASK | ACPI_GPE_DISPATCH_MASK); | 726 | (ACPI_GPE_XRUPT_TYPE_MASK | ACPI_GPE_DISPATCH_MASK); |
727 | 727 | ||
728 | /* | 728 | /* |
729 | * If the GPE is associated with a method and it cannot wake up the | 729 | * If the GPE is associated with a method, it might have been enabled |
730 | * system from sleep states, it was enabled automatically during | 730 | * automatically during initialization, in which case it has to be |
731 | * initialization, so it has to be disabled now to avoid spurious | 731 | * disabled now to avoid spurious execution of the handler. |
732 | * execution of the handler. | ||
733 | */ | 732 | */ |
734 | 733 | ||
735 | if ((handler->orig_flags & ACPI_GPE_DISPATCH_METHOD) | 734 | if ((handler->orig_flags & ACPI_GPE_DISPATCH_METHOD) |
736 | && !(gpe_event_info->flags & ACPI_GPE_CAN_WAKE)) | 735 | && gpe_event_info->runtime_count) { |
736 | handler->orig_enabled = 1; | ||
737 | (void)acpi_raw_disable_gpe(gpe_event_info); | 737 | (void)acpi_raw_disable_gpe(gpe_event_info); |
738 | } | ||
738 | 739 | ||
739 | /* Install the handler */ | 740 | /* Install the handler */ |
740 | 741 | ||
@@ -837,13 +838,13 @@ acpi_remove_gpe_handler(acpi_handle gpe_device, | |||
837 | gpe_event_info->flags |= handler->orig_flags; | 838 | gpe_event_info->flags |= handler->orig_flags; |
838 | 839 | ||
839 | /* | 840 | /* |
840 | * If the GPE was previously associated with a method and it cannot wake | 841 | * If the GPE was previously associated with a method and it was |
841 | * up the system from sleep states, it should be enabled at this point | 842 | * enabled, it should be enabled at this point to restore the |
842 | * to restore the post-initialization configuration. | 843 | * post-initialization configuration. |
843 | */ | 844 | */ |
844 | 845 | ||
845 | if ((handler->orig_flags & ACPI_GPE_DISPATCH_METHOD) | 846 | if ((handler->orig_flags & ACPI_GPE_DISPATCH_METHOD) |
846 | && !(gpe_event_info->flags & ACPI_GPE_CAN_WAKE)) | 847 | && handler->orig_enabled) |
847 | (void)acpi_raw_enable_gpe(gpe_event_info); | 848 | (void)acpi_raw_enable_gpe(gpe_event_info); |
848 | 849 | ||
849 | /* Now we can free the handler object */ | 850 | /* Now we can free the handler object */ |