aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/system.c
diff options
context:
space:
mode:
authorRafael J. Wysocki <rjw@sisk.pl>2010-06-08 04:50:53 -0400
committerLen Brown <len.brown@intel.com>2010-06-12 00:45:28 -0400
commit9d3c752de65dbfa6e522f1d666deb0ac152ef367 (patch)
tree811f3ac51c9fd02c2bf39236cef068e1e44dba72 /drivers/acpi/system.c
parentce43ace02320a3fb9614ddb27edc3a8700d68b26 (diff)
ACPI / ACPICA: Fix sysfs GPE interface
The sysfs interface allowing user space to disable/enable GPEs doesn't work correctly, because a GPE disabled this way will be re-enabled shortly by acpi_ev_asynch_enable_gpe() if it was previosuly enabled by acpi_enable_gpe() (in which case the corresponding bit in its enable register's enable_for_run mask is set). To address this issue make the sysfs GPE interface use acpi_enable_gpe() and acpi_disable_gpe() instead of acpi_set_gpe() so that GPE reference counters are modified by it along with the values of GPE enable registers. Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/system.c')
-rw-r--r--drivers/acpi/system.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/acpi/system.c b/drivers/acpi/system.c
index e35525b39f6b..904e8fce2e74 100644
--- a/drivers/acpi/system.c
+++ b/drivers/acpi/system.c
@@ -388,10 +388,12 @@ static ssize_t counter_set(struct kobject *kobj,
388 if (index < num_gpes) { 388 if (index < num_gpes) {
389 if (!strcmp(buf, "disable\n") && 389 if (!strcmp(buf, "disable\n") &&
390 (status & ACPI_EVENT_FLAG_ENABLED)) 390 (status & ACPI_EVENT_FLAG_ENABLED))
391 result = acpi_set_gpe(handle, index, ACPI_GPE_DISABLE); 391 result = acpi_disable_gpe(handle, index,
392 ACPI_GPE_TYPE_RUNTIME);
392 else if (!strcmp(buf, "enable\n") && 393 else if (!strcmp(buf, "enable\n") &&
393 !(status & ACPI_EVENT_FLAG_ENABLED)) 394 !(status & ACPI_EVENT_FLAG_ENABLED))
394 result = acpi_set_gpe(handle, index, ACPI_GPE_ENABLE); 395 result = acpi_enable_gpe(handle, index,
396 ACPI_GPE_TYPE_RUNTIME);
395 else if (!strcmp(buf, "clear\n") && 397 else if (!strcmp(buf, "clear\n") &&
396 (status & ACPI_EVENT_FLAG_SET)) 398 (status & ACPI_EVENT_FLAG_SET))
397 result = acpi_clear_gpe(handle, index); 399 result = acpi_clear_gpe(handle, index);