Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1809919a authored by Lv Zheng's avatar Lv Zheng Committed by Rafael J. Wysocki
Browse files

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: default avatarLv Zheng <lv.zheng@intel.com>
Signed-off-by: default avatarBob Moore <robert.moore@intel.com>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent 437b7512
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -793,8 +793,9 @@ acpi_install_gpe_handler(acpi_handle gpe_device,
	 * automatically during initialization, in which case it has to be
	 * disabled now to avoid spurious execution of the handler.
	 */
	if ((handler->original_flags & ACPI_GPE_DISPATCH_METHOD)
	    && gpe_event_info->runtime_count) {
	if (((handler->original_flags & ACPI_GPE_DISPATCH_METHOD) ||
	     (handler->original_flags & ACPI_GPE_DISPATCH_NOTIFY)) &&
	    gpe_event_info->runtime_count) {
		handler->originally_enabled = TRUE;
		(void)acpi_ev_remove_gpe_reference(gpe_event_info);

@@ -908,7 +909,8 @@ acpi_remove_gpe_handler(acpi_handle gpe_device,
	 * enabled, it should be enabled at this point to restore the
	 * post-initialization configuration.
	 */
	if ((handler->original_flags & ACPI_GPE_DISPATCH_METHOD) &&
	if (((handler->original_flags & ACPI_GPE_DISPATCH_METHOD) ||
	     (handler->original_flags & ACPI_GPE_DISPATCH_NOTIFY)) &&
	    handler->originally_enabled) {
		(void)acpi_ev_add_gpe_reference(gpe_event_info);
	}