Skip to content

Commit 5d128fb

Browse files
jdelvarerafaeljw
authored andcommitted
ACPI / bus: Only call dmi_check_system() on X86
Calling dmi_check_system() early only works on X86. Other architectures initialize the DMI subsystem later so it's not ready yet when ACPI itself gets initialized. In the best case it results in a useless call to a function which will do nothing. But depending on the dmi implementation, it could also result in warnings. Best is to not call the function when it can't work and isn't needed. Additionally, if anyone ever needs to add non-x86 quirks, it would surprisingly not work, so document the limitation to avoid confusion. Signed-off-by: Jean Delvare <jdelvare@suse.de> Fixes: cce4f63 (ACPI: fix early DSDT dmi check warnings on ia64) Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent 5736184 commit 5d128fb

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

drivers/acpi/bus.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@
3535
#include <linux/delay.h>
3636
#ifdef CONFIG_X86
3737
#include <asm/mpspec.h>
38+
#include <linux/dmi.h>
3839
#endif
3940
#include <linux/acpi_iort.h>
4041
#include <linux/pci.h>
4142
#include <acpi/apei.h>
42-
#include <linux/dmi.h>
4343
#include <linux/suspend.h>
4444

4545
#include "internal.h"
@@ -82,10 +82,6 @@ static const struct dmi_system_id dsdt_dmi_table[] __initconst = {
8282
},
8383
{}
8484
};
85-
#else
86-
static const struct dmi_system_id dsdt_dmi_table[] __initconst = {
87-
{}
88-
};
8985
#endif
9086

9187
/* --------------------------------------------------------------------------
@@ -1033,11 +1029,16 @@ void __init acpi_early_init(void)
10331029

10341030
acpi_permanent_mmap = true;
10351031

1032+
#ifdef CONFIG_X86
10361033
/*
10371034
* If the machine falls into the DMI check table,
1038-
* DSDT will be copied to memory
1035+
* DSDT will be copied to memory.
1036+
* Note that calling dmi_check_system() here on other architectures
1037+
* would not be OK because only x86 initializes dmi early enough.
1038+
* Thankfully only x86 systems need such quirks for now.
10391039
*/
10401040
dmi_check_system(dsdt_dmi_table);
1041+
#endif
10411042

10421043
status = acpi_reallocate_root_table();
10431044
if (ACPI_FAILURE(status)) {

0 commit comments

Comments
 (0)