summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErik Schmauss <erik.schmauss@intel.com>2018-10-17 18:41:21 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2018-10-18 03:19:17 -0400
commitd737f333b211361b6e239fc753b84c3be2634aaa (patch)
tree18bc2593f0bc15ef1f57e2a0b80d29fc3f2685ef
parent08930d56c76a69716ba56eb111379a559a9b9f42 (diff)
ACPI: probe ECDT before loading AML tables regardless of module-level code flag
It was discovered that AML tables were loaded before or after the ECDT depending on acpi_gbl_execute_tables_as_methods. According to the ACPI spec, the ECDT should be loaded before the namespace is populated by loading AML tables (DSDT and SSDT). Since the ECDT should be loaded early in the boot process, this change moves the ECDT probing to acpi_early_init. Signed-off-by: Erik Schmauss <erik.schmauss@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
-rw-r--r--drivers/acpi/bus.c44
1 files changed, 16 insertions, 28 deletions
diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c
index d2e29a19890d..bb3d96dea6db 100644
--- a/drivers/acpi/bus.c
+++ b/drivers/acpi/bus.c
@@ -1054,15 +1054,17 @@ void __init acpi_early_init(void)
1054 goto error0; 1054 goto error0;
1055 } 1055 }
1056 1056
1057 if (!acpi_gbl_execute_tables_as_methods && 1057 /*
1058 acpi_gbl_group_module_level_code) { 1058 * ACPI 2.0 requires the EC driver to be loaded and work before
1059 status = acpi_load_tables(); 1059 * the EC device is found in the namespace (i.e. before
1060 if (ACPI_FAILURE(status)) { 1060 * acpi_load_tables() is called).
1061 printk(KERN_ERR PREFIX 1061 *
1062 "Unable to load the System Description Tables\n"); 1062 * This is accomplished by looking for the ECDT table, and getting
1063 goto error0; 1063 * the EC parameters out of that.
1064 } 1064 *
1065 } 1065 * Ignore the result. Not having an ECDT is not fatal.
1066 */
1067 status = acpi_ec_ecdt_probe();
1066 1068
1067#ifdef CONFIG_X86 1069#ifdef CONFIG_X86
1068 if (!acpi_ioapic) { 1070 if (!acpi_ioapic) {
@@ -1133,25 +1135,11 @@ static int __init acpi_bus_init(void)
1133 1135
1134 acpi_os_initialize1(); 1136 acpi_os_initialize1();
1135 1137
1136 /* 1138 status = acpi_load_tables();
1137 * ACPI 2.0 requires the EC driver to be loaded and work before 1139 if (ACPI_FAILURE(status)) {
1138 * the EC device is found in the namespace (i.e. before 1140 printk(KERN_ERR PREFIX
1139 * acpi_load_tables() is called). 1141 "Unable to load the System Description Tables\n");
1140 * 1142 goto error1;
1141 * This is accomplished by looking for the ECDT table, and getting
1142 * the EC parameters out of that.
1143 */
1144 status = acpi_ec_ecdt_probe();
1145 /* Ignore result. Not having an ECDT is not fatal. */
1146
1147 if (acpi_gbl_execute_tables_as_methods ||
1148 !acpi_gbl_group_module_level_code) {
1149 status = acpi_load_tables();
1150 if (ACPI_FAILURE(status)) {
1151 printk(KERN_ERR PREFIX
1152 "Unable to load the System Description Tables\n");
1153 goto error1;
1154 }
1155 } 1143 }
1156 1144
1157 status = acpi_enable_subsystem(ACPI_NO_ACPI_ENABLE); 1145 status = acpi_enable_subsystem(ACPI_NO_ACPI_ENABLE);