From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752037AbbJTXWh (ORCPT ); Tue, 20 Oct 2015 19:22:37 -0400 Received: from v094114.home.net.pl ([79.96.170.134]:49893 "HELO v094114.home.net.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1751216AbbJTXWe (ORCPT ); Tue, 20 Oct 2015 19:22:34 -0400 From: "Rafael J. Wysocki" To: ACPI Devel Maling List Cc: Linux Kernel Mailing List , Mika Westerberg , Darren Hart Subject: [PATCH] ACPI / property: Fix subnode lookup scope for data-only subnodes Date: Wed, 21 Oct 2015 01:51:24 +0200 Message-ID: <3607867.RKSpENdj9h@vostro.rjw.lan> User-Agent: KMail/4.11.5 (Linux/4.1.0-rc5+; KDE/4.11.5; x86_64; ; ) MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="utf-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Rafael J. Wysocki 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) Signed-off-by: Rafael J. Wysocki --- On top of linux-next. Thanks, Rafael --- drivers/acpi/property.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) Index: linux-pm/drivers/acpi/property.c =================================================================== --- linux-pm.orig/drivers/acpi/property.c +++ 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) {