Skip to contentSkip to conversation

ACPI / ACPICA: Implicit notify for multiple devices

PATCH In review Rafael J. Wysocki 2 participants 7 messages Feb 23, 2011 – Feb 24, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ACPI / ACPICA: Implicit notify for multiple devices

From: Rafael J. Wysocki <[email protected]>

Commit bba63a2 (ACPICA: Implicit notify support) introduced a mechanism that causes a notify request of type ACPI_NOTIFY_DEVICE_WAKE to be queued automatically by acpi_ev_asynch_execute_gpe_method() for the device whose _PRW points to the GPE being handled if that GPE is not associated with an _Lxx/_Exx method. However, it turns out that on some systems there are multiple devices with _PRW pointing to the same GPE without _Lxx/_Exx and the mechanism introduced by commit bba63a2 needs to be extended so that "implicit" notify requests of type ACPI_NOTIFY_DEVICE_WAKE can be queued automatically for all those devices at the same time.

---

Hi Matthew,

The patch below doesn't blow up my Toshiba test box, which is a good sign, but please test it on the boxes where you see the problem.

Thanks,
Rafael

---
 drivers/acpi/acpica/aclocal.h |    7 ++++++-
 drivers/acpi/acpica/evgpe.c   |   17 +++++++++++++----
 drivers/acpi/acpica/evxfgpe.c |   42 +++++++++++++++++++++++++++++++++---------
 3 files changed, 52 insertions(+), 14 deletions(-)
drivers/acpi/acpica/aclocal.h +6 -1
Index: linux-2.6/drivers/acpi/acpica/aclocal.h
===================================================================
@@ -416,10 +416,15 @@ struct acpi_gpe_handler_info {
 	u8 originally_enabled;  /* True if GPE was originally enabled */
 };
 
+struct acpi_gpe_notify_object {
+	struct acpi_namespace_node *node;
+	struct acpi_gpe_notify_object *next;
+};
+
 union acpi_gpe_dispatch_info {
 	struct acpi_namespace_node *method_node;	/* Method node for this GPE level */
 	struct acpi_gpe_handler_info *handler;  /* Installed GPE handler */
-	struct acpi_namespace_node *device_node;        /* Parent _PRW device for implicit notify */
+	struct acpi_gpe_notify_object device;   /* List of _PRW devices for implicit notify */
 };
 
 /*
drivers/acpi/acpica/evxfgpe.c +33 -9

67 lines not on this page · raw message

drivers/acpi/acpica/evgpe.c +13 -4
Index: linux-2.6/drivers/acpi/acpica/evgpe.c
===================================================================
@@ -457,6 +457,7 @@ static void ACPI_SYSTEM_XFACE acpi_ev_as
 	acpi_status status;
 	struct acpi_gpe_event_info *local_gpe_event_info;
 	struct acpi_evaluate_info *info;
+	struct acpi_gpe_notify_object *notify_object;
 
 	ACPI_FUNCTION_TRACE(ev_asynch_execute_gpe_method);
 
@@ -508,10 +509,18 @@ static void ACPI_SYSTEM_XFACE acpi_ev_as
 		 * from this thread -- because handlers may in turn run other
 		 * control methods.
 		 */
-		status =
-		    acpi_ev_queue_notify_request(local_gpe_event_info->dispatch.
-						 device_node,
-						 ACPI_NOTIFY_DEVICE_WAKE);
+		status = acpi_ev_queue_notify_request(
+				local_gpe_event_info->dispatch.device.node,
+				ACPI_NOTIFY_DEVICE_WAKE);
+
+		notify_object = local_gpe_event_info->dispatch.device.next;
+		while (ACPI_SUCCESS(status) && notify_object) {
+			status = acpi_ev_queue_notify_request(
+					notify_object->node,
+					ACPI_NOTIFY_DEVICE_WAKE);
+			notify_object = notify_object->next;
+		}
+
 		break;
 
 	case ACPI_GPE_DISPATCH_METHOD:
#5 lore raw
Quoted 9 lines · Rafael J. Wysocki
Quoted 4 lines · Matthew Garrett

Works on my test Thinkpad - notifies get sent to both EHCI controllers and the HDA hardware now.

Cool, thanks!

How urgent is this issue?

Enabling PCI runtime PM on these machines could cause GPE storms without waking the device.

Signature · 1 line
Matthew Garrett | [email protected]