aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi
diff options
context:
space:
mode:
authorLv Zheng <lv.zheng@intel.com>2014-12-14 19:47:52 -0500
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2014-12-15 09:10:23 -0500
commit1741acea75ea51ce709304a26baf72e1e99b8f3a (patch)
tree5edcf0bba4b240a152fbeb87057324f8dbaeabca /drivers/acpi
parentb2776bf7149bddd1f4161f14f79520f17fc1d71d (diff)
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>
Diffstat (limited to 'drivers/acpi')
-rw-r--r--drivers/acpi/ec.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c
index 5f9b74b9b71f..1b5853f384e2 100644
--- a/drivers/acpi/ec.c
+++ b/drivers/acpi/ec.c
@@ -844,6 +844,8 @@ static int ec_install_handlers(struct acpi_ec *ec)
844 844
845static void ec_remove_handlers(struct acpi_ec *ec) 845static void ec_remove_handlers(struct acpi_ec *ec)
846{ 846{
847 if (!test_bit(EC_FLAGS_HANDLERS_INSTALLED, &ec->flags))
848 return;
847 acpi_disable_gpe(NULL, ec->gpe); 849 acpi_disable_gpe(NULL, ec->gpe);
848 if (ACPI_FAILURE(acpi_remove_address_space_handler(ec->handle, 850 if (ACPI_FAILURE(acpi_remove_address_space_handler(ec->handle,
849 ACPI_ADR_SPACE_EC, &acpi_ec_space_handler))) 851 ACPI_ADR_SPACE_EC, &acpi_ec_space_handler)))