Skip to content

Commit fe6cbea

Browse files
Lv Zhengrafaeljw
authored andcommitted
ACPI 2.0 / ECDT: Enable correct ECDT initialization order
With wrong ECDT fixes reverted, it is possible to put ECDT probing before acpi_enable_subsystem(). But the ultimate purpose of ECDT re-enabling is to put the ECDT probing before the namespace initialization (acpi_load_tables()). This patch achieves this with protections so that we can enable it later when all necessary corrections are upstreamed. Link 4: https://bugzilla.kernel.org/show_bug.cgi?id=112911 Signed-off-by: Lv Zheng <[email protected]> Tested-by: Chris Bainbridge <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent 59f0aa9 commit fe6cbea

File tree

1 file changed

+25
-14
lines changed

1 file changed

+25
-14
lines changed

drivers/acpi/bus.c

Lines changed: 25 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -925,11 +925,13 @@ void __init acpi_early_init(void)
925925
goto error0;
926926
}
927927

928-
status = acpi_load_tables();
929-
if (ACPI_FAILURE(status)) {
930-
printk(KERN_ERR PREFIX
931-
"Unable to load the System Description Tables\n");
932-
goto error0;
928+
if (acpi_gbl_group_module_level_code) {
929+
status = acpi_load_tables();
930+
if (ACPI_FAILURE(status)) {
931+
printk(KERN_ERR PREFIX
932+
"Unable to load the System Description Tables\n");
933+
goto error0;
934+
}
933935
}
934936

935937
#ifdef CONFIG_X86
@@ -995,24 +997,33 @@ static int __init acpi_bus_init(void)
995997

996998
acpi_os_initialize1();
997999

998-
status = acpi_enable_subsystem(ACPI_NO_ACPI_ENABLE);
999-
if (ACPI_FAILURE(status)) {
1000-
printk(KERN_ERR PREFIX
1001-
"Unable to start the ACPI Interpreter\n");
1002-
goto error1;
1003-
}
1004-
10051000
/*
10061001
* ACPI 2.0 requires the EC driver to be loaded and work before
1007-
* the EC device is found in the namespace (i.e. before acpi_initialize_objects()
1008-
* is called).
1002+
* the EC device is found in the namespace (i.e. before
1003+
* acpi_load_tables() is called).
10091004
*
10101005
* This is accomplished by looking for the ECDT table, and getting
10111006
* the EC parameters out of that.
10121007
*/
10131008
status = acpi_ec_ecdt_probe();
10141009
/* Ignore result. Not having an ECDT is not fatal. */
10151010

1011+
if (!acpi_gbl_group_module_level_code) {
1012+
status = acpi_load_tables();
1013+
if (ACPI_FAILURE(status)) {
1014+
printk(KERN_ERR PREFIX
1015+
"Unable to load the System Description Tables\n");
1016+
goto error1;
1017+
}
1018+
}
1019+
1020+
status = acpi_enable_subsystem(ACPI_NO_ACPI_ENABLE);
1021+
if (ACPI_FAILURE(status)) {
1022+
printk(KERN_ERR PREFIX
1023+
"Unable to start the ACPI Interpreter\n");
1024+
goto error1;
1025+
}
1026+
10161027
status = acpi_initialize_objects(ACPI_FULL_INITIALIZATION);
10171028
if (ACPI_FAILURE(status)) {
10181029
printk(KERN_ERR PREFIX "Unable to initialize ACPI objects\n");

0 commit comments

Comments
 (0)