From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from lelv0143.ext.ti.com ([198.47.23.248]:46678 "EHLO lelv0143.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726626AbfEaMqc (ORCPT ); Fri, 31 May 2019 08:46:32 -0400 From: Dan Murphy References: <8704391ae3004a6b4dd17975dbcc9e88bd28cf4b.1559127603.git.nikolaus.voss@loewensteinmedical.de> <2944848d-d004-6750-b95d-825b1758ff22@ti.com> Message-ID: Date: Fri, 31 May 2019 07:46:18 -0500 MIME-Version: 1.0 In-Reply-To: <2944848d-d004-6750-b95d-825b1758ff22@ti.com> Content-Type: text/plain; charset="utf-8"; format="flowed" Content-Transfer-Encoding: 8bit Content-Language: en-US Sender: linux-pwm-owner@vger.kernel.org List-ID: Subject: Re: [PATCH 1/3] ACPI: Resolve objects on host-directed table loads To: Nikolaus Voss , "Rafael J. Wysocki" , Len Brown , Robert Moore , Erik Schmauss , Jacek Anaszewski , Pavel Machek , Thierry Reding Cc: linux-acpi@vger.kernel.org, devel@acpica.org, linux-leds@vger.kernel.org, linux-pwm@vger.kernel.org Nikolaus On 5/30/19 9:42 AM, Dan Murphy wrote: > Nikolaus > > On 5/29/19 7:18 AM, Nikolaus Voss wrote: >> If an ACPI SSDT overlay is loaded after built-in tables >> have been loaded e.g. via configfs or efivar_ssdt_load() >> it is necessary to rewalk the namespace to resolve >> references. Without this, relative and absolute paths >> like ^PCI0.SBUS or \_SB.PCI0.SBUS are not resolved >> correctly. >> >> Make configfs load use the same method as efivar_ssdt_load(). >> >> Signed-off-by: Nikolaus Voss >> --- >>   drivers/acpi/acpi_configfs.c   |  6 +----- >>   drivers/acpi/acpica/tbxfload.c | 11 +++++++++++ >>   2 files changed, 12 insertions(+), 5 deletions(-) >> >> diff --git a/drivers/acpi/acpi_configfs.c b/drivers/acpi/acpi_configfs.c >> index f92033661239..663f0d88f912 100644 >> --- a/drivers/acpi/acpi_configfs.c >> +++ b/drivers/acpi/acpi_configfs.c >> @@ -56,11 +56,7 @@ static ssize_t acpi_table_aml_write(struct >> config_item *cfg, >>       if (!table->header) >>           return -ENOMEM; >>   -    ACPI_INFO(("Host-directed Dynamic ACPI Table Load:")); >> -    ret = acpi_tb_install_and_load_table( >> -            ACPI_PTR_TO_PHYSADDR(table->header), >> -            ACPI_TABLE_ORIGIN_EXTERNAL_VIRTUAL, FALSE, >> -            &table->index); >> +    ret = acpi_load_table(table->header); >>       if (ret) { >>           kfree(table->header); >>           table->header = NULL; >> diff --git a/drivers/acpi/acpica/tbxfload.c >> b/drivers/acpi/acpica/tbxfload.c >> index 4f30f06a6f78..61f2d46e52ba 100644 >> --- a/drivers/acpi/acpica/tbxfload.c >> +++ b/drivers/acpi/acpica/tbxfload.c >> @@ -297,6 +297,17 @@ acpi_status acpi_load_table(struct >> acpi_table_header *table) >>       status = >> acpi_tb_install_and_load_table(ACPI_PTR_TO_PHYSADDR(table), >>                           ACPI_TABLE_ORIGIN_EXTERNAL_VIRTUAL, >>                           FALSE, &table_index); >> + >> +    if (!ACPI_FAILURE(status)) { > Checkpatch should complain about putting brackets around single > statement if's. Would ACPI_SUCCESS make more sense here? Dan