summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafael J. Wysocki <rjw@sisk.pl>2010-06-08 10:50:20 +0200
committerGreg Kroah-Hartman <gregkh@suse.de>2010-08-02 10:30:21 -0700
commit02f7f4c9f46e9da6d0e7f8b380703eaa7a59bebc (patch)
tree8c73b77096252762feca98a0c2e75812f4bd4a6e
parent454981bb0d10548f35d006090a7b4419cdf74c50 (diff)
ACPI / ACPICA: Fix GPE initialization
commit ce43ace02320a3fb9614ddb27edc3a8700d68b26 upstream. While developing the GPE reference counting code we overlooked the fact that acpi_ev_update_gpes() could have enabled GPEs before acpi_ev_initialize_gpe_block() was called. As a result, some GPEs are enabled twice during the initialization. To fix this issue avoid calling acpi_enable_gpe() from acpi_ev_initialize_gpe_block() for the GPEs that have nonzero runtime reference counters. Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Signed-off-by: Len Brown <len.brown@intel.com>
-rw-r--r--drivers/acpi/acpica/evgpeblk.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/drivers/acpi/acpica/evgpeblk.c b/drivers/acpi/acpica/evgpeblk.c
index fef721917eaf..a439850a421c 100644
--- a/drivers/acpi/acpica/evgpeblk.c
+++ b/drivers/acpi/acpica/evgpeblk.c
@@ -1023,6 +1023,19 @@ acpi_ev_initialize_gpe_block(struct acpi_namespace_node *gpe_device,
/* Get the info block for this particular GPE */
gpe_index = (acpi_size)i * ACPI_GPE_REGISTER_WIDTH + j;
gpe_event_info = &gpe_block->event_info[gpe_index];
+ gpe_number = gpe_index + gpe_block->block_base_number;
+
+ /*
+ * If the GPE has already been enabled for runtime
+ * signaling, make sure it remains enabled, but do not
+ * increment its reference counter.
+ */
+ if (gpe_event_info->runtime_count) {
+ acpi_set_gpe(gpe_device, gpe_number,
+ ACPI_GPE_ENABLE);
+ gpe_enabled_count++;
+ continue;
+ }
if (gpe_event_info->flags & ACPI_GPE_CAN_WAKE) {
wake_gpe_count++;
@@ -1033,7 +1046,6 @@ acpi_ev_initialize_gpe_block(struct acpi_namespace_node *gpe_device,
if (!(gpe_event_info->flags & ACPI_GPE_DISPATCH_METHOD))
continue;
- gpe_number = gpe_index + gpe_block->block_base_number;
status = acpi_enable_gpe(gpe_device, gpe_number,
ACPI_GPE_TYPE_RUNTIME);
if (ACPI_FAILURE(status))