From patchwork Thu Oct 8 02:53:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Erik Kaneda X-Patchwork-Id: 268555 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CBCBBC4363A for ; Thu, 8 Oct 2020 03:22:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 89D1E2168B for ; Thu, 8 Oct 2020 03:22:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728062AbgJHDWA (ORCPT ); Wed, 7 Oct 2020 23:22:00 -0400 Received: from mga04.intel.com ([192.55.52.120]:29850 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727449AbgJHDV6 (ORCPT ); Wed, 7 Oct 2020 23:21:58 -0400 IronPort-SDR: BK6nRqR1a9eNKNdCxDY0GtJISHyJJJmJi9rVx0Be6I0iV/2n/LQLspi8fl8pNp85ld41weCt6O o4iuVBE0zuuw== X-IronPort-AV: E=McAfee;i="6000,8403,9767"; a="162613632" X-IronPort-AV: E=Sophos;i="5.77,349,1596524400"; d="scan'208";a="162613632" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Oct 2020 20:21:58 -0700 IronPort-SDR: mYhaNxdlx+KkZQXu14rV2p9U8jnWBDPR/p6qQwsaHt8mVV0hgn6x0oSE/8A9Diu59lvB3nXEfV H/DESAbFnC6g== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,349,1596524400"; d="scan'208";a="355229326" Received: from sibelius.jf.intel.com ([10.54.75.172]) by orsmga007.jf.intel.com with ESMTP; 07 Oct 2020 20:21:58 -0700 From: Erik Kaneda To: "Rafael J . Wysocki" , ACPI Devel Maling List Cc: Colin Ian King , Bob Moore , Erik Kaneda Subject: [PATCH 1/9] ACPICA: Add support for 64 bit risc-v compilation. Date: Wed, 7 Oct 2020 19:53:55 -0700 Message-Id: <20201008025403.2401736-2-erik.kaneda@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201008025403.2401736-1-erik.kaneda@intel.com> References: <20201008025403.2401736-1-erik.kaneda@intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org From: Colin Ian King ACPICA commit 0def627be286620c64a5d4d60ce2373f119169a9 Add 64 bit risc-v architecture. Useful for acpica tools and incorporating ACPICA into the Firmware Test Suite. Link: https://github.com/acpica/acpica/commit/0def627b Signed-off-by: Colin Ian King Signed-off-by: Bob Moore Signed-off-by: Erik Kaneda --- include/acpi/platform/aclinux.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/acpi/platform/aclinux.h b/include/acpi/platform/aclinux.h index 4151c76141fa..72f52a1342a0 100644 --- a/include/acpi/platform/aclinux.h +++ b/include/acpi/platform/aclinux.h @@ -194,7 +194,8 @@ #if defined(__ia64__) || (defined(__x86_64__) && !defined(__ILP32__)) ||\ defined(__aarch64__) || defined(__PPC64__) ||\ - defined(__s390x__) + defined(__s390x__) ||\ + (defined(__riscv) && (defined(__LP64__) || defined(_LP64))) #define ACPI_MACHINE_WIDTH 64 #define COMPILER_DEPENDENT_INT64 long #define COMPILER_DEPENDENT_UINT64 unsigned long From patchwork Thu Oct 8 02:53:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Erik Kaneda X-Patchwork-Id: 268232 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A6962C433E7 for ; Thu, 8 Oct 2020 03:22:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6562521527 for ; Thu, 8 Oct 2020 03:22:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728137AbgJHDWA (ORCPT ); Wed, 7 Oct 2020 23:22:00 -0400 Received: from mga04.intel.com ([192.55.52.120]:29856 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728062AbgJHDV7 (ORCPT ); Wed, 7 Oct 2020 23:21:59 -0400 IronPort-SDR: nkSRqxj0hmty1rTw2XtUs7suX0DGT4egK87Id4mfQG5ofp+Zv/rxjpz2PNl++hA62g3LqksHnQ zAPaCk/c0BEQ== X-IronPort-AV: E=McAfee;i="6000,8403,9767"; a="162613635" X-IronPort-AV: E=Sophos;i="5.77,349,1596524400"; d="scan'208";a="162613635" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Oct 2020 20:21:59 -0700 IronPort-SDR: qs3tDKVuzwR2EolU0b6zYy+2zXIhg1YGVPh0dHwERNbcHbIBTn+A7oSWRNR2BlbMM0Vtfi4y+t rBEmb82xW8qw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,349,1596524400"; d="scan'208";a="355229332" Received: from sibelius.jf.intel.com ([10.54.75.172]) by orsmga007.jf.intel.com with ESMTP; 07 Oct 2020 20:21:59 -0700 From: Erik Kaneda To: "Rafael J . Wysocki" , ACPI Devel Maling List Cc: Randy Dunlap , Erik Kaneda , Bob Moore Subject: [PATCH 2/9] ACPICA: Drop the repeated word "an" in a comment. Date: Wed, 7 Oct 2020 19:53:56 -0700 Message-Id: <20201008025403.2401736-3-erik.kaneda@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201008025403.2401736-1-erik.kaneda@intel.com> References: <20201008025403.2401736-1-erik.kaneda@intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org From: Randy Dunlap ACPICA commit 9ed2c006444d1def55bc6f08164ed5d9e809c856 Link: https://github.com/acpica/acpica/commit/9ed2c006 Signed-off-by: Randy Dunlap Signed-off-by: Erik Kaneda Signed-off-by: Bob Moore --- include/acpi/actypes.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h index d50e61384f1f..647cb11d0a0a 100644 --- a/include/acpi/actypes.h +++ b/include/acpi/actypes.h @@ -824,7 +824,7 @@ typedef u8 acpi_adr_space_type; * * Note: A Data Table region is a special type of operation region * that has its own AML opcode. However, internally, the AML - * interpreter simply creates an operation region with an an address + * interpreter simply creates an operation region with an address * space type of ACPI_ADR_SPACE_DATA_TABLE. */ #define ACPI_ADR_SPACE_DATA_TABLE (acpi_adr_space_type) 0x7E /* Internal to ACPICA only */ From patchwork Thu Oct 8 02:53:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Erik Kaneda X-Patchwork-Id: 268231 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 56AABC4363A for ; Thu, 8 Oct 2020 03:22:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1B22C21527 for ; Thu, 8 Oct 2020 03:22:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728218AbgJHDWC (ORCPT ); Wed, 7 Oct 2020 23:22:02 -0400 Received: from mga04.intel.com ([192.55.52.120]:29857 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727449AbgJHDWA (ORCPT ); Wed, 7 Oct 2020 23:22:00 -0400 IronPort-SDR: 0a7TT12NTsb8mmkH4MyXqgjbuintjRmN8gDfpX7BSz5whbcBywVDV/rtVZKdnxLVbgVcqXPrKI gsWmgoJ0MFyA== X-IronPort-AV: E=McAfee;i="6000,8403,9767"; a="162613638" X-IronPort-AV: E=Sophos;i="5.77,349,1596524400"; d="scan'208";a="162613638" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Oct 2020 20:22:00 -0700 IronPort-SDR: /BnFkEI4EHlolZ67fD72LjtSkCZ6K/+uQfVuPE6wa1c3t43JKhnA/S9Lz1kYgEAf/GKkzURGJ5 7iVwsATbFRdw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,349,1596524400"; d="scan'208";a="355229335" Received: from sibelius.jf.intel.com ([10.54.75.172]) by orsmga007.jf.intel.com with ESMTP; 07 Oct 2020 20:22:00 -0700 From: Erik Kaneda To: "Rafael J . Wysocki" , ACPI Devel Maling List Cc: Colin Ian King , Bob Moore , Erik Kaneda Subject: [PATCH 3/9] ACPICA: Tree-wide: fix various typos and spelling mistakes Date: Wed, 7 Oct 2020 19:53:57 -0700 Message-Id: <20201008025403.2401736-4-erik.kaneda@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201008025403.2401736-1-erik.kaneda@intel.com> References: <20201008025403.2401736-1-erik.kaneda@intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org From: Colin Ian King ACPICA commit 6648a6ac8410813bcfedb5c8345259dd155ea851 Fix spelling issues found using the codespell checker Link: https://github.com/acpica/acpica/commit/6648a6ac Signed-off-by: Colin Ian King Signed-off-by: Bob Moore Signed-off-by: Erik Kaneda --- drivers/acpi/acpica/dbinput.c | 2 +- drivers/acpi/acpica/nsxfobj.c | 3 ++- include/acpi/acconfig.h | 2 +- tools/power/acpi/os_specific/service_layers/oslinuxtbl.c | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/acpi/acpica/dbinput.c b/drivers/acpi/acpica/dbinput.c index ee6a1b77af3f..568d1b0b1f5d 100644 --- a/drivers/acpi/acpica/dbinput.c +++ b/drivers/acpi/acpica/dbinput.c @@ -436,7 +436,7 @@ static void acpi_db_display_help(char *command) acpi_os_printf("\n"); } else { - /* Display help for all commands that match the subtring */ + /* Display help for all commands that match the substring */ acpi_db_display_command_info(command, TRUE); } diff --git a/drivers/acpi/acpica/nsxfobj.c b/drivers/acpi/acpica/nsxfobj.c index c022bef263e5..324269481160 100644 --- a/drivers/acpi/acpica/nsxfobj.c +++ b/drivers/acpi/acpica/nsxfobj.c @@ -24,7 +24,8 @@ ACPI_MODULE_NAME("nsxfobj") * * RETURN: Status * - * DESCRIPTION: This routine returns the type associatd with a particular handle + * DESCRIPTION: This routine returns the type associated with a particular + * handle * ******************************************************************************/ acpi_status acpi_get_type(acpi_handle handle, acpi_object_type *ret_type) diff --git a/include/acpi/acconfig.h b/include/acpi/acconfig.h index 5940a3c68a96..a225eff499c8 100644 --- a/include/acpi/acconfig.h +++ b/include/acpi/acconfig.h @@ -121,7 +121,7 @@ * *****************************************************************************/ -/* Method info (in WALK_STATE), containing local variables and argumetns */ +/* Method info (in WALK_STATE), containing local variables and arguments */ #define ACPI_METHOD_NUM_LOCALS 8 #define ACPI_METHOD_MAX_LOCAL 7 diff --git a/tools/power/acpi/os_specific/service_layers/oslinuxtbl.c b/tools/power/acpi/os_specific/service_layers/oslinuxtbl.c index dd38c2b2e1b4..11c5046dce16 100644 --- a/tools/power/acpi/os_specific/service_layers/oslinuxtbl.c +++ b/tools/power/acpi/os_specific/service_layers/oslinuxtbl.c @@ -110,7 +110,7 @@ u32 gbl_table_count = 0; * * RETURN: Status; Converted from errno. * - * DESCRIPTION: Get last errno and conver it to acpi_status. + * DESCRIPTION: Get last errno and convert it to acpi_status. * *****************************************************************************/ From patchwork Thu Oct 8 02:53:58 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Erik Kaneda X-Patchwork-Id: 268554 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A28AFC433E7 for ; Thu, 8 Oct 2020 03:22:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5125321924 for ; Thu, 8 Oct 2020 03:22:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727449AbgJHDWC (ORCPT ); Wed, 7 Oct 2020 23:22:02 -0400 Received: from mga04.intel.com ([192.55.52.120]:29860 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728188AbgJHDWB (ORCPT ); Wed, 7 Oct 2020 23:22:01 -0400 IronPort-SDR: Agb//3F/jhy1sXS+ibjDXUFVc2HYFyPul60a+KAU3kDvrd01LalZLOjGWLPMI3S4odEdEscsi8 A1585uSpZHRg== X-IronPort-AV: E=McAfee;i="6000,8403,9767"; a="162613642" X-IronPort-AV: E=Sophos;i="5.77,349,1596524400"; d="scan'208";a="162613642" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Oct 2020 20:22:00 -0700 IronPort-SDR: adcyEbOrSP0r2aUwDEaRDR5pPHUzkCUYlkCdoiMo0tCOQCyuj4pVFmiTidsNg6SJ7S36FSX2wv 5sdJTS3RMelA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,349,1596524400"; d="scan'208";a="355229339" Received: from sibelius.jf.intel.com ([10.54.75.172]) by orsmga007.jf.intel.com with ESMTP; 07 Oct 2020 20:22:00 -0700 From: Erik Kaneda To: "Rafael J . Wysocki" , ACPI Devel Maling List Cc: Bob Moore , Erik Kaneda Subject: [PATCH 4/9] ACPICA: Add predefined names found in the SMBus sepcification Date: Wed, 7 Oct 2020 19:53:58 -0700 Message-Id: <20201008025403.2401736-5-erik.kaneda@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201008025403.2401736-1-erik.kaneda@intel.com> References: <20201008025403.2401736-1-erik.kaneda@intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org From: Bob Moore Affects run-time (kernel) ACPICA, iASL, and acpi_help. The "SMBus Control Method Interface Specification, Version 1.0, December 10, 1999" containes predefined names: _SBA _SBI _SBR _SBT _SBW. This was done outside of the ACPI specification. This commit adds support for ACPICA to recognize these named objects as predefined named objects. ACPICA commit 2fe13bd7ba9f97d3bf25488bf1bb1b2329427093 Link: https://github.com/acpica/acpica/commit/2fe13bd7 Signed-off-by: Bob Moore Signed-off-by: Erik Kaneda --- drivers/acpi/acpica/acpredef.h | 33 ++++++++++++++++++++++++++++++- drivers/acpi/acpica/nsarguments.c | 4 +++- drivers/acpi/acpica/psparse.c | 4 ++-- drivers/acpi/acpica/utpredef.c | 5 ++--- 4 files changed, 39 insertions(+), 7 deletions(-) diff --git a/drivers/acpi/acpica/acpredef.h b/drivers/acpi/acpica/acpredef.h index 2cbb56652f1c..57ea2276790f 100644 --- a/drivers/acpi/acpica/acpredef.h +++ b/drivers/acpi/acpica/acpredef.h @@ -101,7 +101,7 @@ enum acpi_return_package_types { /* Support macros for users of the predefined info table */ -#define METHOD_PREDEF_ARGS_MAX 4 +#define METHOD_PREDEF_ARGS_MAX 5 #define METHOD_ARG_BIT_WIDTH 3 #define METHOD_ARG_MASK 0x0007 #define ARG_COUNT_IS_MINIMUM 0x8000 @@ -117,6 +117,7 @@ enum acpi_return_package_types { #define METHOD_2ARGS(a1,a2) (2 | (a1 << 3) | (a2 << 6)) #define METHOD_3ARGS(a1,a2,a3) (3 | (a1 << 3) | (a2 << 6) | (a3 << 9)) #define METHOD_4ARGS(a1,a2,a3,a4) (4 | (a1 << 3) | (a2 << 6) | (a3 << 9) | (a4 << 12)) +#define METHOD_5ARGS(a1,a2,a3,a4,a5) (5 | (a1 << 3) | (a2 << 6) | (a3 << 9) | (a4 << 12) | (a5 << 15)) #define METHOD_RETURNS(type) (type) #define METHOD_NO_RETURN_VALUE 0 @@ -902,9 +903,39 @@ const union acpi_predefined_info acpi_gbl_predefined_methods[] = { {{"_S4W", METHOD_0ARGS, METHOD_RETURNS(ACPI_RTYPE_INTEGER)}}, + {{"_SBA", METHOD_0ARGS, + METHOD_RETURNS(ACPI_RTYPE_PACKAGE)}}, /* Fixed-length (4 Int) */ + PACKAGE_INFO(ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 4, 0, 0, 0), + + {{"_SBI", METHOD_0ARGS, + METHOD_RETURNS(ACPI_RTYPE_PACKAGE)}}, /* Fixed-length (1 Int, 1 Buf) */ + PACKAGE_INFO(ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 1, + ACPI_RTYPE_BUFFER, 1, 0), + + {{"_SBR", + METHOD_3ARGS(ACPI_TYPE_INTEGER, ACPI_TYPE_INTEGER, + ACPI_TYPE_INTEGER), + METHOD_RETURNS(ACPI_RTYPE_PACKAGE)}}, /* Fixed-length (2 Int) */ + PACKAGE_INFO(ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 2, + ACPI_RTYPE_BUFFER | ACPI_RTYPE_INTEGER, 1, 0), + {{"_SBS", METHOD_0ARGS, METHOD_RETURNS(ACPI_RTYPE_INTEGER)}}, + {{"_SBT", + METHOD_4ARGS(ACPI_TYPE_INTEGER, ACPI_TYPE_INTEGER, ACPI_TYPE_INTEGER, + ACPI_TYPE_ANY), + METHOD_RETURNS(ACPI_RTYPE_PACKAGE)}}, /* Fixed-length (2 Int, 1 Buf | Int) */ + PACKAGE_INFO(ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 2, + ACPI_RTYPE_BUFFER | ACPI_RTYPE_INTEGER, 1, 0), + + {{"_SBW", + METHOD_5ARGS(ACPI_TYPE_INTEGER, ACPI_TYPE_INTEGER, ACPI_TYPE_INTEGER, + ACPI_TYPE_INTEGER, ACPI_TYPE_ANY), + METHOD_RETURNS(ACPI_RTYPE_PACKAGE)}}, + PACKAGE_INFO(ACPI_PTYPE1_FIXED, ACPI_RTYPE_BUFFER | ACPI_RTYPE_INTEGER, + 1, 0, 0, 0), + {{"_SCP", METHOD_1ARGS(ACPI_TYPE_INTEGER) | ARG_COUNT_IS_MINIMUM, METHOD_NO_RETURN_VALUE}}, /* Acpi 1.0 allowed 1 integer arg. Acpi 3.0 expanded to 3 args. Allow both. */ diff --git a/drivers/acpi/acpica/nsarguments.c b/drivers/acpi/acpica/nsarguments.c index d5e8405e9d8f..6bbc7d350a16 100644 --- a/drivers/acpi/acpica/nsarguments.c +++ b/drivers/acpi/acpica/nsarguments.c @@ -55,7 +55,9 @@ void acpi_ns_check_argument_types(struct acpi_evaluate_info *info) arg_type = METHOD_GET_NEXT_TYPE(arg_type_list); user_arg_type = info->parameters[i]->common.type; - if (user_arg_type != arg_type) { + /* No typechecking for ACPI_TYPE_ANY */ + + if ((user_arg_type != arg_type) && (arg_type != ACPI_TYPE_ANY)) { ACPI_WARN_PREDEFINED((AE_INFO, info->full_pathname, ACPI_WARN_ALWAYS, "Argument #%u type mismatch - " diff --git a/drivers/acpi/acpica/psparse.c b/drivers/acpi/acpica/psparse.c index c780046bf294..bd3caf735be3 100644 --- a/drivers/acpi/acpica/psparse.c +++ b/drivers/acpi/acpica/psparse.c @@ -508,8 +508,8 @@ acpi_status acpi_ps_parse_aml(struct acpi_walk_state *walk_state) } /* - * If the transfer to the new method method call worked - *, a new walk state was created -- get it + * If the transfer to the new method method call worked, + * a new walk state was created -- get it */ walk_state = acpi_ds_get_current_walk_state(thread); continue; diff --git a/drivers/acpi/acpica/utpredef.c b/drivers/acpi/acpica/utpredef.c index 05fe3470fb93..dd277f7e9f10 100644 --- a/drivers/acpi/acpica/utpredef.c +++ b/drivers/acpi/acpica/utpredef.c @@ -151,7 +151,7 @@ static u32 acpi_ut_get_argument_types(char *buffer, u16 argument_types); static const char *ut_external_type_names[] = /* Indexed by ACPI_TYPE_* */ { - ", UNSUPPORTED-TYPE", + ", Type_ANY", ", Integer", ", String", ", Buffer", @@ -311,8 +311,7 @@ static u32 acpi_ut_get_argument_types(char *buffer, u16 argument_types) for (i = 0; i < arg_count; i++) { this_argument_type = METHOD_GET_NEXT_TYPE(argument_types); - if (!this_argument_type - || (this_argument_type > METHOD_MAX_ARG_TYPE)) { + if (this_argument_type > METHOD_MAX_ARG_TYPE) { printf("**** Invalid argument type (%u) " "in predefined info structure\n", this_argument_type); From patchwork Thu Oct 8 02:53:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Erik Kaneda X-Patchwork-Id: 268553 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D31B2C47095 for ; Thu, 8 Oct 2020 03:22:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9C2DB21941 for ; Thu, 8 Oct 2020 03:22:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728225AbgJHDWD (ORCPT ); Wed, 7 Oct 2020 23:22:03 -0400 Received: from mga04.intel.com ([192.55.52.120]:29857 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728209AbgJHDWC (ORCPT ); Wed, 7 Oct 2020 23:22:02 -0400 IronPort-SDR: hjWMYFk3WS2MZsjGA/zUjrWiyh9KxeB0FVVyamw/34cni44l0KzI7lb602by6qPaZPVCZTBPdr mbGEIgzGYrJA== X-IronPort-AV: E=McAfee;i="6000,8403,9767"; a="162613645" X-IronPort-AV: E=Sophos;i="5.77,349,1596524400"; d="scan'208";a="162613645" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Oct 2020 20:22:01 -0700 IronPort-SDR: 9CsDmXHpwhbYGo/seVvjMlT5AtQB8ewSFORmH0Sa0QdApLsPMNwoPtxtvsHmUYk7WpuVjWwcDg 82sGkv9M0Dwg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,349,1596524400"; d="scan'208";a="355229343" Received: from sibelius.jf.intel.com ([10.54.75.172]) by orsmga007.jf.intel.com with ESMTP; 07 Oct 2020 20:22:01 -0700 From: Erik Kaneda To: "Rafael J . Wysocki" , ACPI Devel Maling List Cc: Bob Moore , Erik Kaneda Subject: [PATCH 5/9] ACPICA: acpi_help: Update UUID list Date: Wed, 7 Oct 2020 19:53:59 -0700 Message-Id: <20201008025403.2401736-6-erik.kaneda@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201008025403.2401736-1-erik.kaneda@intel.com> References: <20201008025403.2401736-1-erik.kaneda@intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org From: Bob Moore Added the following UUID's Memory Device Generic Buttons Device NVDIMM Root Device Control Method Battery Device Graphs for _DSD method Hierarchical Data Extension ARM core_sight Graph UUID This commit squashes the following ACPICA commits: 93e9aa864a7c5e10db876a9af3f2086e50cc6cf5 759aaf73942af4a1a0d13715ce5e6b054af351fa 24751ce4cf3089a7c1709e4986bc82dfb5cca7bc Link: https://github.com/acpica/acpica/commit/93e9aa86 Link: https://github.com/acpica/acpica/commit/759aaf73 Link: https://github.com/acpica/acpica/commit/24751ce4 Signed-off-by: Bob Moore Signed-off-by: Erik Kaneda --- include/acpi/acuuid.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/acpi/acuuid.h b/include/acpi/acuuid.h index 9e1367b19069..10e30a5030ee 100644 --- a/include/acpi/acuuid.h +++ b/include/acpi/acuuid.h @@ -27,6 +27,10 @@ #define UUID_PCI_HOST_BRIDGE "33db4d5b-1ff7-401c-9657-7441c03dd766" #define UUID_I2C_DEVICE "3cdff6f7-4267-4555-ad05-b30a3d8938de" #define UUID_POWER_BUTTON "dfbcf3c5-e7a5-44e6-9c1f-29c76f6e059c" +#define UUID_MEMORY_DEVICE "03b19910-f473-11dd-87af-0800200c9a66" +#define UUID_GENERIC_BUTTONS_DEVICE "fa6bd625-9ce8-470d-a2c7-b3ca36c4282e" +#define UUID_NVDIMM_ROOT_DEVICE "2f10e7a4-9e91-11e4-89d3-123b93f75cba" +#define UUID_CONTROL_METHOD_BATTERY "f18fc78b-0f15-4978-b793-53f833a1d35b" /* Interfaces */ @@ -56,5 +60,8 @@ #define UUID_BATTERY_THERMAL_LIMIT "4c2067e3-887d-475c-9720-4af1d3ed602e" #define UUID_THERMAL_EXTENSIONS "14d399cd-7a27-4b18-8fb4-7cb7b9f4e500" #define UUID_DEVICE_PROPERTIES "daffd814-6eba-4d8c-8a91-bc9bbf4aa301" +#define UUID_DEVICE_GRAPHS "ab02a46b-74c7-45a2-bd68-f7d344ef2153" +#define UUID_HIERARCHICAL_DATA_EXTENSION "dbb8e3e6-5886-4ba6-8795-1319f52a966b" +#define UUID_CORESIGHT_GRAPH "3ecbc8b6-1d0e-4fb3-8107-e627f805c6cd" #endif /* __ACUUID_H__ */ From patchwork Thu Oct 8 02:54:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Erik Kaneda X-Patchwork-Id: 268230 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0BB05C4727E for ; Thu, 8 Oct 2020 03:22:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BEB3C21D20 for ; Thu, 8 Oct 2020 03:22:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728209AbgJHDWD (ORCPT ); Wed, 7 Oct 2020 23:22:03 -0400 Received: from mga04.intel.com ([192.55.52.120]:29860 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728216AbgJHDWC (ORCPT ); Wed, 7 Oct 2020 23:22:02 -0400 IronPort-SDR: R7LT2grrkTdHG66lgvu8TMluSlJPjV4AvHtEtOGi+E3isLhaf+8lcvJIOUH6vykfzg0KNpWGUh G/pWnVr18uGw== X-IronPort-AV: E=McAfee;i="6000,8403,9767"; a="162613649" X-IronPort-AV: E=Sophos;i="5.77,349,1596524400"; d="scan'208";a="162613649" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Oct 2020 20:22:02 -0700 IronPort-SDR: QmOYT7Ytyc12/ljelaAZgSUUHW68UVkuf7shxsAefiN+9dSfZ6HF1GweurbFaDoYkvnP2QDoJ4 RMC7+svIw0pA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,349,1596524400"; d="scan'208";a="355229347" Received: from sibelius.jf.intel.com ([10.54.75.172]) by orsmga007.jf.intel.com with ESMTP; 07 Oct 2020 20:22:02 -0700 From: Erik Kaneda To: "Rafael J . Wysocki" , ACPI Devel Maling List Cc: Bob Moore , Erik Kaneda Subject: [PATCH 6/9] ACPICA: iASL: Return exceptions for string-to-integer conversions Date: Wed, 7 Oct 2020 19:54:00 -0700 Message-Id: <20201008025403.2401736-7-erik.kaneda@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201008025403.2401736-1-erik.kaneda@intel.com> References: <20201008025403.2401736-1-erik.kaneda@intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org From: Bob Moore This allows iASL to generate errors by passing exceptions that may be encountered during string-to-integer conversions. The exceptions point out invalid hex, decimal, and octal integers. ACPICA commit e98b8c0a3d96fdabb167c0ef18a809b32ade3228 Link: https://github.com/acpica/acpica/commit/e98b8c0a Signed-off-by: Bob Moore Signed-off-by: Erik Kaneda --- drivers/acpi/acpica/utstrsuppt.c | 33 +++++++++++++++++++++++--------- include/acpi/acexcep.h | 4 ++-- 2 files changed, 26 insertions(+), 11 deletions(-) diff --git a/drivers/acpi/acpica/utstrsuppt.c b/drivers/acpi/acpica/utstrsuppt.c index 05ff20049b87..2d91003fcf26 100644 --- a/drivers/acpi/acpica/utstrsuppt.c +++ b/drivers/acpi/acpica/utstrsuppt.c @@ -45,10 +45,15 @@ acpi_status acpi_ut_convert_octal_string(char *string, u64 *return_value_ptr) /* Convert each ASCII byte in the input string */ while (*string) { - - /* Character must be ASCII 0-7, otherwise terminate with no error */ - + /* + * Character must be ASCII 0-7, otherwise: + * 1) Runtime: terminate with no error, per the ACPI spec + * 2) Compiler: return an error + */ if (!(ACPI_IS_OCTAL_DIGIT(*string))) { +#ifdef ACPI_ASL_COMPILER + status = AE_BAD_OCTAL_CONSTANT; +#endif break; } @@ -94,10 +99,15 @@ acpi_status acpi_ut_convert_decimal_string(char *string, u64 *return_value_ptr) /* Convert each ASCII byte in the input string */ while (*string) { - - /* Character must be ASCII 0-9, otherwise terminate with no error */ - + /* + * Character must be ASCII 0-9, otherwise: + * 1) Runtime: terminate with no error, per the ACPI spec + * 2) Compiler: return an error + */ if (!isdigit(*string)) { +#ifdef ACPI_ASL_COMPILER + status = AE_BAD_DECIMAL_CONSTANT; +#endif break; } @@ -143,10 +153,15 @@ acpi_status acpi_ut_convert_hex_string(char *string, u64 *return_value_ptr) /* Convert each ASCII byte in the input string */ while (*string) { - - /* Must be ASCII A-F, a-f, or 0-9, otherwise terminate with no error */ - + /* + * Character must be ASCII A-F, a-f, or 0-9, otherwise: + * 1) Runtime: terminate with no error, per the ACPI spec + * 2) Compiler: return an error + */ if (!isxdigit(*string)) { +#ifdef ACPI_ASL_COMPILER + status = AE_BAD_HEX_CONSTANT; +#endif break; } diff --git a/include/acpi/acexcep.h b/include/acpi/acexcep.h index 436cd1411c3a..2fc624a61769 100644 --- a/include/acpi/acexcep.h +++ b/include/acpi/acexcep.h @@ -40,12 +40,12 @@ struct acpi_exception_info { char *name; -#ifdef ACPI_HELP_APP +#if defined (ACPI_HELP_APP) || defined (ACPI_ASL_COMPILER) char *description; #endif }; -#ifdef ACPI_HELP_APP +#if defined (ACPI_HELP_APP) || defined (ACPI_ASL_COMPILER) #define EXCEP_TXT(name,description) {name, description} #else #define EXCEP_TXT(name,description) {name} From patchwork Thu Oct 8 02:54:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Erik Kaneda X-Patchwork-Id: 268552 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8C528C4727F for ; Thu, 8 Oct 2020 03:22:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2C7F62145D for ; Thu, 8 Oct 2020 03:22:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728237AbgJHDWE (ORCPT ); Wed, 7 Oct 2020 23:22:04 -0400 Received: from mga04.intel.com ([192.55.52.120]:29857 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728188AbgJHDWD (ORCPT ); Wed, 7 Oct 2020 23:22:03 -0400 IronPort-SDR: cprx7rVmqMdPy6M5AvJZx7toxUtNWqr05HyB0eWwcVhQ9UXAxqfsvdmZ1VOwLNdii8dbOqirnf 50GmKSgb2+Uw== X-IronPort-AV: E=McAfee;i="6000,8403,9767"; a="162613653" X-IronPort-AV: E=Sophos;i="5.77,349,1596524400"; d="scan'208";a="162613653" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Oct 2020 20:22:02 -0700 IronPort-SDR: X6OcPgqoq3AnvIblU9PQYphKHQ2HoDsZQcrJWM+VBwLiV+EHcrj9mY8UcC4vAjHzyaF1BMfaYU Jz81G8bS+Q1w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,349,1596524400"; d="scan'208";a="355229352" Received: from sibelius.jf.intel.com ([10.54.75.172]) by orsmga007.jf.intel.com with ESMTP; 07 Oct 2020 20:22:02 -0700 From: Erik Kaneda To: "Rafael J . Wysocki" , ACPI Devel Maling List Cc: Bob Moore , Erik Kaneda Subject: [PATCH 7/9] ACPICA: Debugger: Add a new command: "ALL " Date: Wed, 7 Oct 2020 19:54:01 -0700 Message-Id: <20201008025403.2401736-8-erik.kaneda@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201008025403.2401736-1-erik.kaneda@intel.com> References: <20201008025403.2401736-1-erik.kaneda@intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org From: Bob Moore This command will execute/evaluate all objects with a match to the argument. ACPICA commit a1a32ec054f067d1617067e2bafb0a27a8728e07 Link: https://github.com/acpica/acpica/commit/a1a32ec0 Signed-off-by: Bob Moore Signed-off-by: Erik Kaneda --- drivers/acpi/acpica/acdebug.h | 4 + drivers/acpi/acpica/dbexec.c | 39 ++++++-- drivers/acpi/acpica/dbinput.c | 12 +++ drivers/acpi/acpica/dbmethod.c | 167 ++++++++++++++++++++++++++++----- 4 files changed, 188 insertions(+), 34 deletions(-) diff --git a/drivers/acpi/acpica/acdebug.h b/drivers/acpi/acpica/acdebug.h index a676daaa2da5..f8a3abdfe250 100644 --- a/drivers/acpi/acpica/acdebug.h +++ b/drivers/acpi/acpica/acdebug.h @@ -37,12 +37,14 @@ struct acpi_db_argument_info { struct acpi_db_execute_walk { u32 count; u32 max_count; + char name_seg[ACPI_NAMESEG_SIZE + 1]; }; #define PARAM_LIST(pl) pl #define EX_NO_SINGLE_STEP 1 #define EX_SINGLE_STEP 2 +#define EX_ALL 4 /* * dbxface - external debugger interfaces @@ -124,6 +126,8 @@ void acpi_db_disassemble_aml(char *statements, union acpi_parse_object *op); void acpi_db_evaluate_predefined_names(void); +void acpi_db_evaluate_all(char *name_seg); + /* * dbnames - namespace commands */ diff --git a/drivers/acpi/acpica/dbexec.c b/drivers/acpi/acpica/dbexec.c index 4027eaab18a4..d3a9521e2dc8 100644 --- a/drivers/acpi/acpica/dbexec.c +++ b/drivers/acpi/acpica/dbexec.c @@ -86,7 +86,8 @@ void acpi_db_delete_objects(u32 count, union acpi_object *objects) * * RETURN: Status * - * DESCRIPTION: Execute a control method. + * DESCRIPTION: Execute a control method. Used to evaluate objects via the + * "EXECUTE" or "EVALUATE" commands. * ******************************************************************************/ @@ -314,11 +315,12 @@ acpi_db_execution_walk(acpi_handle obj_handle, status = acpi_evaluate_object(node, NULL, NULL, &return_obj); + acpi_gbl_method_executing = FALSE; + acpi_os_printf("Evaluation of [%4.4s] returned %s\n", acpi_ut_get_node_name(node), acpi_format_exception(status)); - acpi_gbl_method_executing = FALSE; return (AE_OK); } @@ -334,7 +336,8 @@ acpi_db_execution_walk(acpi_handle obj_handle, * RETURN: None * * DESCRIPTION: Execute a control method. Name is relative to the current - * scope. + * scope. Function used for the "EXECUTE", "EVALUATE", and + * "ALL" commands * ******************************************************************************/ @@ -372,6 +375,12 @@ acpi_db_execute(char *name, char **args, acpi_object_type *types, u32 flags) return; } + if ((flags & EX_ALL) && (strlen(name) > 4)) { + acpi_os_printf("Input name (%s) must be a 4-char NameSeg\n", + name); + return; + } + name_string = ACPI_ALLOCATE(strlen(name) + 1); if (!name_string) { return; @@ -389,13 +398,24 @@ acpi_db_execute(char *name, char **args, acpi_object_type *types, u32 flags) return; } - acpi_gbl_db_method_info.name = name_string; - acpi_gbl_db_method_info.args = args; - acpi_gbl_db_method_info.types = types; - acpi_gbl_db_method_info.flags = flags; + /* Command (ALL ) to execute all methods of a particular name */ - return_obj.pointer = NULL; - return_obj.length = ACPI_ALLOCATE_BUFFER; + else if (flags & EX_ALL) { + acpi_gbl_db_method_info.name = name_string; + return_obj.pointer = NULL; + return_obj.length = ACPI_ALLOCATE_BUFFER; + acpi_db_evaluate_all(name_string); + ACPI_FREE(name_string); + return; + } else { + acpi_gbl_db_method_info.name = name_string; + acpi_gbl_db_method_info.args = args; + acpi_gbl_db_method_info.types = types; + acpi_gbl_db_method_info.flags = flags; + + return_obj.pointer = NULL; + return_obj.length = ACPI_ALLOCATE_BUFFER; + } status = acpi_db_execute_setup(&acpi_gbl_db_method_info); if (ACPI_FAILURE(status)) { @@ -450,6 +470,7 @@ acpi_db_execute(char *name, char **args, acpi_object_type *types, u32 flags) (u32)return_obj.length); acpi_db_dump_external_object(return_obj.pointer, 1); + acpi_os_printf("\n"); /* Dump a _PLD buffer if present */ diff --git a/drivers/acpi/acpica/dbinput.c b/drivers/acpi/acpica/dbinput.c index 568d1b0b1f5d..2952856b8a67 100644 --- a/drivers/acpi/acpica/dbinput.c +++ b/drivers/acpi/acpica/dbinput.c @@ -37,6 +37,7 @@ acpi_db_match_command_help(const char *command, enum acpi_ex_debugger_commands { CMD_NOT_FOUND = 0, CMD_NULL, + CMD_ALL, CMD_ALLOCATIONS, CMD_ARGS, CMD_ARGUMENTS, @@ -115,6 +116,7 @@ enum acpi_ex_debugger_commands { static const struct acpi_db_command_info acpi_gbl_db_commands[] = { {"", 0}, {"", 0}, + {"ALL", 1}, {"ALLOCATIONS", 0}, {"ARGS", 0}, {"ARGUMENTS", 0}, @@ -222,6 +224,7 @@ static const struct acpi_db_command_help acpi_gbl_db_command_help[] = { {1, " Type ", "Display object type\n"}, {0, "\nControl Method Execution:", "\n"}, + {1, " All ", "Evaluate all objects named NameSeg\n"}, {1, " Evaluate [Arguments]", "Evaluate object or control method\n"}, {1, " Execute [Arguments]", "Synonym for Evaluate\n"}, @@ -740,6 +743,15 @@ acpi_db_command_dispatch(char *input_buffer, } break; + case CMD_ALL: + + acpi_os_printf("Executing all objects with NameSeg: %s\n", + acpi_gbl_db_args[1]); + acpi_db_execute(acpi_gbl_db_args[1], &acpi_gbl_db_args[2], + &acpi_gbl_db_arg_types[2], + EX_NO_SINGLE_STEP | EX_ALL); + break; + case CMD_ALLOCATIONS: #ifdef ACPI_DBG_TRACK_ALLOCATIONS diff --git a/drivers/acpi/acpica/dbmethod.c b/drivers/acpi/acpica/dbmethod.c index 4e48a7de7413..889d13828e49 100644 --- a/drivers/acpi/acpica/dbmethod.c +++ b/drivers/acpi/acpica/dbmethod.c @@ -21,6 +21,8 @@ static acpi_status acpi_db_walk_for_execute(acpi_handle obj_handle, u32 nesting_level, void *context, void **return_value); +static acpi_status acpi_db_evaluate_object(struct acpi_namespace_node *node); + /******************************************************************************* * * FUNCTION: acpi_db_set_method_breakpoint @@ -346,42 +348,26 @@ acpi_status acpi_db_disassemble_method(char *name) /******************************************************************************* * - * FUNCTION: acpi_db_walk_for_execute + * FUNCTION: acpi_db_evaluate_object * - * PARAMETERS: Callback from walk_namespace + * PARAMETERS: node - Namespace node for the object * * RETURN: Status * - * DESCRIPTION: Batch execution module. Currently only executes predefined - * ACPI names. + * DESCRIPTION: Main execution function for the Evaluate/Execute/All debugger + * commands. * ******************************************************************************/ -static acpi_status -acpi_db_walk_for_execute(acpi_handle obj_handle, - u32 nesting_level, void *context, void **return_value) +static acpi_status acpi_db_evaluate_object(struct acpi_namespace_node *node) { - struct acpi_namespace_node *node = - (struct acpi_namespace_node *)obj_handle; - struct acpi_db_execute_walk *info = - (struct acpi_db_execute_walk *)context; - struct acpi_buffer return_obj; - acpi_status status; char *pathname; u32 i; struct acpi_device_info *obj_info; struct acpi_object_list param_objects; union acpi_object params[ACPI_METHOD_NUM_ARGS]; - const union acpi_predefined_info *predefined; - - predefined = acpi_ut_match_predefined_method(node->name.ascii); - if (!predefined) { - return (AE_OK); - } - - if (node->type == ACPI_TYPE_LOCAL_SCOPE) { - return (AE_OK); - } + struct acpi_buffer return_obj; + acpi_status status; pathname = acpi_ns_get_external_pathname(node); if (!pathname) { @@ -390,7 +376,7 @@ acpi_db_walk_for_execute(acpi_handle obj_handle, /* Get the object info for number of method parameters */ - status = acpi_get_object_info(obj_handle, &obj_info); + status = acpi_get_object_info(node, &obj_info); if (ACPI_FAILURE(status)) { ACPI_FREE(pathname); return (status); @@ -421,14 +407,67 @@ acpi_db_walk_for_execute(acpi_handle obj_handle, acpi_gbl_method_executing = TRUE; status = acpi_evaluate_object(node, NULL, ¶m_objects, &return_obj); + acpi_gbl_method_executing = FALSE; acpi_os_printf("%-32s returned %s\n", pathname, acpi_format_exception(status)); - acpi_gbl_method_executing = FALSE; + if (return_obj.length) { + acpi_os_printf("Evaluation of %s returned object %p, " + "external buffer length %X\n", + pathname, return_obj.pointer, + (u32)return_obj.length); + + acpi_db_dump_external_object(return_obj.pointer, 1); + acpi_os_printf("\n"); + } + ACPI_FREE(pathname); /* Ignore status from method execution */ + return (AE_OK); + + /* Update count, check if we have executed enough methods */ + +} + +/******************************************************************************* + * + * FUNCTION: acpi_db_walk_for_execute + * + * PARAMETERS: Callback from walk_namespace + * + * RETURN: Status + * + * DESCRIPTION: Batch execution function. Evaluates all "predefined" objects -- + * the nameseg begins with an underscore. + * + ******************************************************************************/ + +static acpi_status +acpi_db_walk_for_execute(acpi_handle obj_handle, + u32 nesting_level, void *context, void **return_value) +{ + struct acpi_namespace_node *node = + (struct acpi_namespace_node *)obj_handle; + struct acpi_db_execute_walk *info = + (struct acpi_db_execute_walk *)context; + acpi_status status; + const union acpi_predefined_info *predefined; + + predefined = acpi_ut_match_predefined_method(node->name.ascii); + if (!predefined) { + return (AE_OK); + } + + if (node->type == ACPI_TYPE_LOCAL_SCOPE) { + return (AE_OK); + } + + acpi_db_evaluate_object(node); + + /* Ignore status from object evaluation */ + status = AE_OK; /* Update count, check if we have executed enough methods */ @@ -441,6 +480,52 @@ acpi_db_walk_for_execute(acpi_handle obj_handle, return (status); } +/******************************************************************************* + * + * FUNCTION: acpi_db_walk_for_execute_all + * + * PARAMETERS: Callback from walk_namespace + * + * RETURN: Status + * + * DESCRIPTION: Batch execution function. Evaluates all objects whose path ends + * with the nameseg "Info->NameSeg". Used for the "ALL" command. + * + ******************************************************************************/ + +static acpi_status +acpi_db_walk_for_execute_all(acpi_handle obj_handle, + u32 nesting_level, + void *context, void **return_value) +{ + struct acpi_namespace_node *node = + (struct acpi_namespace_node *)obj_handle; + struct acpi_db_execute_walk *info = + (struct acpi_db_execute_walk *)context; + acpi_status status; + + if (!ACPI_COMPARE_NAMESEG(node->name.ascii, info->name_seg)) { + return (AE_OK); + } + + if (node->type == ACPI_TYPE_LOCAL_SCOPE) { + return (AE_OK); + } + + /* Now evaluate the input object (node) */ + + acpi_db_evaluate_object(node); + + /* Ignore status from method execution */ + + status = AE_OK; + + /* Update count of executed methods/objects */ + + info->count++; + return (status); +} + /******************************************************************************* * * FUNCTION: acpi_db_evaluate_predefined_names @@ -470,3 +555,35 @@ void acpi_db_evaluate_predefined_names(void) acpi_os_printf("Evaluated %u predefined names in the namespace\n", info.count); } + +/******************************************************************************* + * + * FUNCTION: acpi_db_evaluate_all + * + * PARAMETERS: none_acpi_gbl_db_method_info + * + * RETURN: None + * + * DESCRIPTION: Namespace batch execution. Implements the "ALL" command. + * Execute all namepaths whose final nameseg matches the + * input nameseg. + * + ******************************************************************************/ + +void acpi_db_evaluate_all(char *name_seg) +{ + struct acpi_db_execute_walk info; + + info.count = 0; + info.max_count = ACPI_UINT32_MAX; + ACPI_COPY_NAMESEG(info.name_seg, name_seg); + info.name_seg[ACPI_NAMESEG_SIZE] = 0; + + /* Search all nodes in namespace */ + + (void)acpi_walk_namespace(ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, + ACPI_UINT32_MAX, acpi_db_walk_for_execute_all, + NULL, (void *)&info, NULL); + + acpi_os_printf("Evaluated %u names in the namespace\n", info.count); +} From patchwork Thu Oct 8 02:54:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Erik Kaneda X-Patchwork-Id: 268229 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B3D53C47420 for ; Thu, 8 Oct 2020 03:22:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 62E7C21897 for ; Thu, 8 Oct 2020 03:22:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728188AbgJHDWE (ORCPT ); Wed, 7 Oct 2020 23:22:04 -0400 Received: from mga04.intel.com ([192.55.52.120]:29865 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728216AbgJHDWD (ORCPT ); Wed, 7 Oct 2020 23:22:03 -0400 IronPort-SDR: RgCSVfm1zGoqk2FP+pukSdkNoshZvKLEHXyWu1fsiZ8goMmclvFQ9OzcsGXa4bttJNi06AHNkf McgMaQkve2Pw== X-IronPort-AV: E=McAfee;i="6000,8403,9767"; a="162613658" X-IronPort-AV: E=Sophos;i="5.77,349,1596524400"; d="scan'208";a="162613658" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Oct 2020 20:22:03 -0700 IronPort-SDR: gCWvr/hj31D1E5nIS2fME8dnUJb6Fvj2m8OhI/rXBF/myY1X2HRGDODMYKVm2qnGJJ25EMaWMC qi/YNNRCi/5g== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,349,1596524400"; d="scan'208";a="355229355" Received: from sibelius.jf.intel.com ([10.54.75.172]) by orsmga007.jf.intel.com with ESMTP; 07 Oct 2020 20:22:03 -0700 From: Erik Kaneda To: "Rafael J . Wysocki" , ACPI Devel Maling List Cc: Bob Moore , Erik Kaneda Subject: [PATCH 8/9] ACPICA: Remove unnecessary semicolon Date: Wed, 7 Oct 2020 19:54:02 -0700 Message-Id: <20201008025403.2401736-9-erik.kaneda@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201008025403.2401736-1-erik.kaneda@intel.com> References: <20201008025403.2401736-1-erik.kaneda@intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org From: Bob Moore ACPICA commit 02ffcba2af123a891eefbaed4d37780ba1e36ccc Reported by: Zou Wei. Link: https://github.com/acpica/acpica/commit/02ffcba2 Signed-off-by: Bob Moore Signed-off-by: Erik Kaneda --- drivers/acpi/acpica/nsalloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/acpi/acpica/nsalloc.c b/drivers/acpi/acpica/nsalloc.c index fe9b3639a87d..83d26abcf448 100644 --- a/drivers/acpi/acpica/nsalloc.c +++ b/drivers/acpi/acpica/nsalloc.c @@ -294,7 +294,7 @@ void acpi_ns_delete_children(struct acpi_namespace_node *parent_node) node_to_delete = next_node; next_node = next_node->peer; acpi_ns_delete_node(node_to_delete); - }; + } /* Clear the parent's child pointer */ From patchwork Thu Oct 8 02:54:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Erik Kaneda X-Patchwork-Id: 268228 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 88468C4363A for ; Thu, 8 Oct 2020 03:22:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3E7B721527 for ; Thu, 8 Oct 2020 03:22:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728216AbgJHDWG (ORCPT ); Wed, 7 Oct 2020 23:22:06 -0400 Received: from mga04.intel.com ([192.55.52.120]:29857 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728231AbgJHDWE (ORCPT ); Wed, 7 Oct 2020 23:22:04 -0400 IronPort-SDR: 9npoGQhAByjs0g7keEsrn2lVO2nMen5To5mF1O8jhrHGdSaW4Isl8M4KtLQ0lKsn7skhx7A3Om TRPJnoMs3D4g== X-IronPort-AV: E=McAfee;i="6000,8403,9767"; a="162613659" X-IronPort-AV: E=Sophos;i="5.77,349,1596524400"; d="scan'208";a="162613659" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Oct 2020 20:22:04 -0700 IronPort-SDR: RXwbvcZyny9OWwLYuRNzKUo8liTk848ZHZ8Ey0K59sGBWd1wXRJrT+WsfbS8FAin1ZudGkGe34 AhNCnigvQ6CQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,349,1596524400"; d="scan'208";a="355229361" Received: from sibelius.jf.intel.com ([10.54.75.172]) by orsmga007.jf.intel.com with ESMTP; 07 Oct 2020 20:22:04 -0700 From: Erik Kaneda To: "Rafael J . Wysocki" , ACPI Devel Maling List Cc: Bob Moore , Erik Kaneda Subject: [PATCH 9/9] ACPICA: Update version to 20200925 Version 20200925. Date: Wed, 7 Oct 2020 19:54:03 -0700 Message-Id: <20201008025403.2401736-10-erik.kaneda@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201008025403.2401736-1-erik.kaneda@intel.com> References: <20201008025403.2401736-1-erik.kaneda@intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org From: Bob Moore ACPICA commit 70add34a9a4729b5496d0695ad14d6a1dc435879 Link: https://github.com/acpica/acpica/commit/70add34a Signed-off-by: Bob Moore Signed-off-by: Erik Kaneda --- include/acpi/acpixf.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h index 9dc816641286..be7de305a622 100644 --- a/include/acpi/acpixf.h +++ b/include/acpi/acpixf.h @@ -12,7 +12,7 @@ /* Current ACPICA subsystem version in YYYYMMDD format */ -#define ACPI_CA_VERSION 0x20200717 +#define ACPI_CA_VERSION 0x20200925 #include #include