Skip to contentSkip to conversation

ACPI / property: Fix subnode lookup scope for data-only subnodes

PATCH In review Rafael J. Wysocki 2 participants 3 messages Oct 20, 2015 – Oct 21, 2015 ACPI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ACPI / property: Fix subnode lookup scope for data-only subnodes

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

The correct scope for looking up the objects to generate data packages for data-only subnodes pointed to by another data-only subnode is the scope of the parent of that subnode and not the scope containing the _DSD object at the top of the hierarchy (the latter works only if all of the objects returning data-only subnode packages in a given hierarchy are in the same scope).

Fix the code to work as expected.

Fixes 445b0eb058f5 (ACPI / property: Add support for data-only subnodes)

---

On top of linux-next.

Thanks,
Rafael

---
 drivers/acpi/property.c |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/acpi/property.c +8 -1
Index: linux-pm/drivers/acpi/property.c
===================================================================
@@ -71,7 +71,14 @@ static bool acpi_nondev_subnode_ok(acpi_
 	if (acpi_extract_properties(buf.pointer, &dn->data))
 		dn->handle = handle;
 
-	if (acpi_enumerate_nondev_subnodes(scope, buf.pointer, &dn->data))
+	/*
+	 * The scope for the subnode object lookup is the one of the namespace
+	 * node (device) containing the object that has returned the package.
+	 * That is, it's the scope of that object's parent.
+	 */
+	status = acpi_get_parent(handle, &scope);
+	if (ACPI_SUCCESS(status)
+	    && acpi_enumerate_nondev_subnodes(scope, buf.pointer, &dn->data))
 		dn->handle = handle;
 
 	if (dn->handle) {
Reviewed-by Tested-by on v1 1/1
#1 lore raw
Quoted 9 lines · Rafael J. Wysocki

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

The correct scope for looking up the objects to generate data packages for data-only subnodes pointed to by another data-only subnode is the scope of the parent of that subnode and not the scope containing the _DSD object at the top of the hierarchy (the latter works only if all of the objects returning data-only subnode packages in a given hierarchy are in the same scope).

Quoted 4 lines

Fix the code to work as expected.

Fixes 445b0eb058f5 (ACPI / property: Add support for data-only subnodes)

All my tests still pass so you can also add

#2 lore raw
Quoted 12 lines · Mika Westerberg
Quoted 11 lines · Rafael J. Wysocki

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

The correct scope for looking up the objects to generate data packages for data-only subnodes pointed to by another data-only subnode is the scope of the parent of that subnode and not the scope containing the _DSD object at the top of the hierarchy (the latter works only if all of the objects returning data-only subnode packages in a given hierarchy are in the same scope).

Fix the code to work as expected.

Quoted 8 lines
Quoted 2 lines
Fixes 445b0eb058f5 (ACPI / property: Add support for data-only subnodes)

All my tests still pass so you can also add

Thanks!