[B/OEM-B] [PATCH 6/8] ACPICA: Remove acpi_gbl_group_module_level_code and only use acpi_gbl_execute_tables_as_methods instead

Kai-Heng Feng kai.heng.feng at canonical.com
Thu Jul 4 04:50:20 UTC 2019

From: Erik Schmauss <erik.schmauss at intel.com>

BugLink: https://bugs.launchpad.net/bugs/1835357

acpi_gbl_group_module_level_code and acpi_gbl_execute_tables_as_methods were
used to enable different table load behavior. The different table
load behaviors are as follows:

A.) acpi_gbl_group_module_level_code enabled the legacy approach where
    ASL if statements are executed after the namespace object has
    been loaded.
B.) acpi_gbl_execute_tables_as_methods is currently used to enable the
    table load to be a method invocation. This meaning that ASL If
    statements are executed in-line rather than deferred until after
    the ACPI namespace has been populated. This is the correct
    behavior and option A will be removed in the future.

We do not support a table load behavior where these variables are
assigned the same value. In otherwords, we only support option A or B
and do not need acpi_gbl_group_module_level_code to enable A. From now on,
acpi_gbl_execute_tables_as_methods == 0 enables option A and
acpi_gbl_execute_tables_as_methods == 1 enables option B.

Note: option A is expected to be removed in the future and option B
will become the only supported table load behavior.

Signed-off-by: Erik Schmauss <erik.schmauss at intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki at intel.com>
(backported from commit 08930d56c76a69716ba56eb111379a559a9b9f42)
Signed-off-by: Kai-Heng Feng <kai.heng.feng at canonical.com>
 drivers/acpi/acpica/psloop.c   | 2 +-
 drivers/acpi/acpica/tbxfload.c | 3 +--
 include/acpi/acpixf.h          | 7 -------
 3 files changed, 2 insertions(+), 10 deletions(-)

diff --git a/drivers/acpi/acpica/psloop.c b/drivers/acpi/acpica/psloop.c
index 1ad4a6362aac..d24cb3bb7c16 100644
--- a/drivers/acpi/acpica/psloop.c
+++ b/drivers/acpi/acpica/psloop.c
@@ -180,7 +180,7 @@ acpi_ps_get_arguments(struct acpi_walk_state *walk_state,
 		 * future. Use of this option can cause problems with AML code that
 		 * depends upon in-order immediate execution of module-level code.
-		if (acpi_gbl_group_module_level_code &&
+		if (!acpi_gbl_parse_table_as_term_list &&
 		    (walk_state->pass_number <= ACPI_IMODE_LOAD_PASS2) &&
 		    ((walk_state->parse_flags & ACPI_PARSE_DISASSEMBLE) == 0)) {
diff --git a/drivers/acpi/acpica/tbxfload.c b/drivers/acpi/acpica/tbxfload.c
index 05fad1bce458..8409a5f2de19 100644
--- a/drivers/acpi/acpica/tbxfload.c
+++ b/drivers/acpi/acpica/tbxfload.c
@@ -103,8 +103,7 @@ acpi_status ACPI_INIT_FUNCTION acpi_load_tables(void)
 				"While loading namespace from ACPI tables"));
-	if (acpi_gbl_parse_table_as_term_list
-	    || !acpi_gbl_group_module_level_code) {
+	if (acpi_gbl_parse_table_as_term_list) {
 		 * If the module-level code support is enabled, initialize the objects
 		 * in the namespace that remain uninitialized. This runs the executable
diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h
index bf6f2a5cfa7f..f2c4224e7471 100644
--- a/include/acpi/acpixf.h
+++ b/include/acpi/acpixf.h
@@ -190,13 +190,6 @@ ACPI_INIT_GLOBAL(u8, acpi_gbl_copy_dsdt_locally, FALSE);
 ACPI_INIT_GLOBAL(u8, acpi_gbl_do_not_use_xsdt, FALSE);
- * Optionally support group module level code.
- * NOTE, this is essentially obsolete and will be removed soon
- * (01/2018).
- */
-ACPI_INIT_GLOBAL(u8, acpi_gbl_group_module_level_code, FALSE);
  * Optionally support module level code by parsing the entire table as
  * a term_list. Default is FALSE, do not execute entire table until some

More information about the kernel-team mailing list