ACPI / ACPICA: Avoid writing full enable masks to GPE registers
commit454981bb0d10548f35d006090a7b4419cdf74c50
authorRafael J. Wysocki <rjw@sisk.pl>
Tue, 8 Jun 2010 08:49:45 +0000 (8 10:49 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 2 Aug 2010 17:30:20 +0000 (2 10:30 -0700)
tree2820aab8fcd37097ce03725fff2534e5e0b21418
parenta1399262df1450b960e0c3875ce50c43a4e3499e
ACPI / ACPICA: Avoid writing full enable masks to GPE registers

commit c9a8bbb7704cbf515c0fc68970abbe4e91d68521 upstream.

ACPICA uses acpi_hw_write_gpe_enable_reg() to re-enable a GPE after
an event signaled by it has been handled.  However, this function
writes the entire GPE enable mask to the GPE's enable register which
may not be correct.  Namely, if one of the other GPEs in the same
register was previously enabled by acpi_enable_gpe() and subsequently
disabled using acpi_set_gpe(), acpi_hw_write_gpe_enable_reg() will
re-enable it along with the target GPE.

To fix this issue rework acpi_hw_write_gpe_enable_reg() so that it
calls acpi_hw_low_set_gpe() with a special action value,
ACPI_GPE_COND_ENABLE, that will make it only enable the GPE if the
corresponding bit in its register's enable_for_run mask is set.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/acpi/acpica/hwgpe.c
include/acpi/actypes.h