ACPI/EC: Fix an issue that ec_remove_handlers() is invoked unexpectedly.
PATCH 1/1 ACPI/EC: Fix an issue that ec_remove_handlers() is invoked unexpectedly.
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 <[email protected]>
Signed-off-by Lv Zheng <[email protected]>
--- drivers/acpi/ec.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/acpi/ec.c +2 -0
@@ -844,6 +844,8 @@ static int ec_install_handlers(struct acpi_ec *ec)static void ec_remove_handlers (struct acpi_ec *ec) { +if (!test_bit (EC_FLAGS_HANDLERS_INSTALLED , &ec->flags)) +return ;acpi_disable_gpe (NULL , ec->gpe);if (ACPI_FAILURE (acpi_remove_address_space_handler (ec->handle,ACPI_ADR_SPACE_EC , &acpi_ec_space_handler)))
Signature · 1 line
1.7.10
Rafael J. Wysocki
AppliedQuoted 8 lines · Lv Zheng
The
ec_remove_handlers()is invoked without checkingEC_FLAGS_HANDLERS_INSTALLED, this patch enhances this check to avoid issues thatacpi_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 <[email protected]>Signed-off-by Lv Zheng <[email protected]>
Applied, thanks!
Quoted 18 lines
--- drivers/acpi/ec.c | 2 ++ 1 file changed, 2 insertions(+)drivers/acpi/ec.c +2
-0@@ -844,6 +844,8 @@ static int ec_install_handlers(struct acpi_ec *ec)static void ec_remove_handlers (struct acpi_ec *ec) { +if (!test_bit (EC_FLAGS_HANDLERS_INSTALLED , &ec->flags)) +return ;acpi_disable_gpe (NULL , ec->gpe);if (ACPI_FAILURE (acpi_remove_address_space_handler (ec->handle,ACPI_ADR_SPACE_EC , &acpi_ec_space_handler)))
Signature · 2 lines
I speak only for myself. Rafael J. Wysocki, Intel Open Source Technology Center.