linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ACPI / ACPICA: Do not check reference counters in acpi_ev_enable_gpe()
@ 2010-03-16 22:21 Rafael J. Wysocki
  2010-03-23  4:23 ` Len Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Rafael J. Wysocki @ 2010-03-16 22:21 UTC (permalink / raw)
  To: Len Brown
  Cc: Moore, Robert, Matthew Garrett, pm list, ACPI Devel Maling List,
	LKML, Andrew Morton

From: Rafael J. Wysocki <rjw@sisk.pl>

acpi_ev_enable_gpe() should enable the GPE at the hardware level
regardless of the value of the GPE's runtime reference counter.

There are only two callers of acpi_ev_enable_gpe(), acpi_enable_gpe()
and acpi_set_gpe().  The first one checks the GPE's runtime
reference counter itself and only calls acpi_ev_enable_gpe() if it's
equal to one, and the other one is supposed to enable the GPE
unconditionally (if called with ACPI_GPE_ENABLE).

This change fixes the problem in acpi_enable_wakeup_device() where
the GPE will not be enabled for wakeup if it's runtime reference
counter is zero, which is a regression from 2.6.33.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Reported-by: Robert Moore <robert.moore@intel.com>
---
 drivers/acpi/acpica/evgpe.c |   19 +++++++------------
 1 file changed, 7 insertions(+), 12 deletions(-)

Index: linux-2.6/drivers/acpi/acpica/evgpe.c
===================================================================
--- linux-2.6.orig/drivers/acpi/acpica/evgpe.c
+++ linux-2.6/drivers/acpi/acpica/evgpe.c
@@ -117,19 +117,14 @@ acpi_status acpi_ev_enable_gpe(struct ac
 	if (ACPI_FAILURE(status))
 		return_ACPI_STATUS(status);
 
-	/* Mark wake-enabled or HW enable, or both */
-
-	if (gpe_event_info->runtime_count) {
-		/* Clear the GPE (of stale events), then enable it */
-		status = acpi_hw_clear_gpe(gpe_event_info);
-		if (ACPI_FAILURE(status))
-			return_ACPI_STATUS(status);
-
-		/* Enable the requested runtime GPE */
-		status = acpi_hw_write_gpe_enable_reg(gpe_event_info);
-	}
+	/* Clear the GPE (of stale events), then enable it */
+	status = acpi_hw_clear_gpe(gpe_event_info);
+	if (ACPI_FAILURE(status))
+		return_ACPI_STATUS(status);
 
-	return_ACPI_STATUS(AE_OK);
+	/* Enable the requested GPE */
+	status = acpi_hw_write_gpe_enable_reg(gpe_event_info);
+	return_ACPI_STATUS(status);
 }
 
 /*******************************************************************************

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] ACPI / ACPICA: Do not check reference counters in acpi_ev_enable_gpe()
  2010-03-16 22:21 [PATCH] ACPI / ACPICA: Do not check reference counters in acpi_ev_enable_gpe() Rafael J. Wysocki
@ 2010-03-23  4:23 ` Len Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Len Brown @ 2010-03-23  4:23 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Moore, Robert, Matthew Garrett, pm list, ACPI Devel Maling List,
	LKML, Andrew Morton

applied

thanks,
Len Brown, Intel Open Source Technology Center


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-03-23  4:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-03-16 22:21 [PATCH] ACPI / ACPICA: Do not check reference counters in acpi_ev_enable_gpe() Rafael J. Wysocki
2010-03-23  4:23 ` Len Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).