Skip to content

Commit 1741ace

Browse files
Lv Zhengrafaeljw
authored andcommitted
ACPI / EC: Fix unexpected ec_remove_handlers() invocations
The ec_remove_handlers() is invoked without checking EC_FLAGS_HANDLERS_INSTALLED, this patch enhances this check to avoid issues that acpi_disable_gpe() is invoked unexpectedly to reduce the GPE runtime count. This may happen when the EC handler installation failed on some platforms. Reported-by: Venkat Raghavulu <venkat.raghavulu@intel.com> Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent b2776bf commit 1741ace

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/acpi/ec.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -844,6 +844,8 @@ static int ec_install_handlers(struct acpi_ec *ec)
844844

845845
static void ec_remove_handlers(struct acpi_ec *ec)
846846
{
847+
if (!test_bit(EC_FLAGS_HANDLERS_INSTALLED, &ec->flags))
848+
return;
847849
acpi_disable_gpe(NULL, ec->gpe);
848850
if (ACPI_FAILURE(acpi_remove_address_space_handler(ec->handle,
849851
ACPI_ADR_SPACE_EC, &acpi_ec_space_handler)))

0 commit comments

Comments
 (0)