Commit 9d3c752d authored by Rafael J. Wysocki's avatar Rafael J. Wysocki Committed by Len Brown

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: default avatarRafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: default avatarLen Brown <len.brown@intel.com>
parent ce43ace0
...@@ -388,10 +388,12 @@ static ssize_t counter_set(struct kobject *kobj, ...@@ -388,10 +388,12 @@ static ssize_t counter_set(struct kobject *kobj,
if (index < num_gpes) { if (index < num_gpes) {
if (!strcmp(buf, "disable\n") && if (!strcmp(buf, "disable\n") &&
(status & ACPI_EVENT_FLAG_ENABLED)) (status & ACPI_EVENT_FLAG_ENABLED))
result = acpi_set_gpe(handle, index, ACPI_GPE_DISABLE); result = acpi_disable_gpe(handle, index,
ACPI_GPE_TYPE_RUNTIME);
else if (!strcmp(buf, "enable\n") && else if (!strcmp(buf, "enable\n") &&
!(status & ACPI_EVENT_FLAG_ENABLED)) !(status & ACPI_EVENT_FLAG_ENABLED))
result = acpi_set_gpe(handle, index, ACPI_GPE_ENABLE); result = acpi_enable_gpe(handle, index,
ACPI_GPE_TYPE_RUNTIME);
else if (!strcmp(buf, "clear\n") && else if (!strcmp(buf, "clear\n") &&
(status & ACPI_EVENT_FLAG_SET)) (status & ACPI_EVENT_FLAG_SET))
result = acpi_clear_gpe(handle, index); result = acpi_clear_gpe(handle, index);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment