Skip to content

Commit 47cbb41

Browse files
committed
Merge tag 'acpi-6.14-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull ACPI fixes from Rafael Wysocki: "Add a new ACPI-related quirk for Vexia EDU ATLA 10 tablet 5V (Hans de Goede) and fix the MADT parsing code so that CPUs with different entry types (LAPIC and x2APIC) are initialized in the order in which they appear in the MADT as required by the ACPI specification (Zhang Rui)" * tag 'acpi-6.14-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: x86/acpi: Fix LAPIC/x2APIC parsing order ACPI: x86: Add skip i2c clients quirk for Vexia EDU ATLA 10 tablet 5V
2 parents f55b067 + 0141978 commit 47cbb41

File tree

2 files changed

+58
-5
lines changed

2 files changed

+58
-5
lines changed

arch/x86/kernel/acpi/boot.c

Lines changed: 45 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,28 @@ acpi_parse_x2apic(union acpi_subtable_headers *header, const unsigned long end)
226226
return 0;
227227
}
228228

229+
static int __init
230+
acpi_check_lapic(union acpi_subtable_headers *header, const unsigned long end)
231+
{
232+
struct acpi_madt_local_apic *processor = NULL;
233+
234+
processor = (struct acpi_madt_local_apic *)header;
235+
236+
if (BAD_MADT_ENTRY(processor, end))
237+
return -EINVAL;
238+
239+
/* Ignore invalid ID */
240+
if (processor->id == 0xff)
241+
return 0;
242+
243+
/* Ignore processors that can not be onlined */
244+
if (!acpi_is_processor_usable(processor->lapic_flags))
245+
return 0;
246+
247+
has_lapic_cpus = true;
248+
return 0;
249+
}
250+
229251
static int __init
230252
acpi_parse_lapic(union acpi_subtable_headers * header, const unsigned long end)
231253
{
@@ -257,7 +279,6 @@ acpi_parse_lapic(union acpi_subtable_headers * header, const unsigned long end)
257279
processor->processor_id, /* ACPI ID */
258280
processor->lapic_flags & ACPI_MADT_ENABLED);
259281

260-
has_lapic_cpus = true;
261282
return 0;
262283
}
263284

@@ -1026,6 +1047,8 @@ static int __init early_acpi_parse_madt_lapic_addr_ovr(void)
10261047
static int __init acpi_parse_madt_lapic_entries(void)
10271048
{
10281049
int count, x2count = 0;
1050+
struct acpi_subtable_proc madt_proc[2];
1051+
int ret;
10291052

10301053
if (!boot_cpu_has(X86_FEATURE_APIC))
10311054
return -ENODEV;
@@ -1034,10 +1057,27 @@ static int __init acpi_parse_madt_lapic_entries(void)
10341057
acpi_parse_sapic, MAX_LOCAL_APIC);
10351058

10361059
if (!count) {
1037-
count = acpi_table_parse_madt(ACPI_MADT_TYPE_LOCAL_APIC,
1038-
acpi_parse_lapic, MAX_LOCAL_APIC);
1039-
x2count = acpi_table_parse_madt(ACPI_MADT_TYPE_LOCAL_X2APIC,
1040-
acpi_parse_x2apic, MAX_LOCAL_APIC);
1060+
/* Check if there are valid LAPIC entries */
1061+
acpi_table_parse_madt(ACPI_MADT_TYPE_LOCAL_APIC, acpi_check_lapic, MAX_LOCAL_APIC);
1062+
1063+
/*
1064+
* Enumerate the APIC IDs in the order that they appear in the
1065+
* MADT, no matter LAPIC entry or x2APIC entry is used.
1066+
*/
1067+
memset(madt_proc, 0, sizeof(madt_proc));
1068+
madt_proc[0].id = ACPI_MADT_TYPE_LOCAL_APIC;
1069+
madt_proc[0].handler = acpi_parse_lapic;
1070+
madt_proc[1].id = ACPI_MADT_TYPE_LOCAL_X2APIC;
1071+
madt_proc[1].handler = acpi_parse_x2apic;
1072+
ret = acpi_table_parse_entries_array(ACPI_SIG_MADT,
1073+
sizeof(struct acpi_table_madt),
1074+
madt_proc, ARRAY_SIZE(madt_proc), MAX_LOCAL_APIC);
1075+
if (ret < 0) {
1076+
pr_err("Error parsing LAPIC/X2APIC entries\n");
1077+
return ret;
1078+
}
1079+
count = madt_proc[0].count;
1080+
x2count = madt_proc[1].count;
10411081
}
10421082
if (!count && !x2count) {
10431083
pr_err("No LAPIC entries present\n");

drivers/acpi/x86/utils.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,19 @@ static const struct dmi_system_id acpi_quirk_skip_dmi_ids[] = {
407407
.driver_data = (void *)(ACPI_QUIRK_SKIP_I2C_CLIENTS |
408408
ACPI_QUIRK_SKIP_ACPI_AC_AND_BATTERY),
409409
},
410+
{
411+
/* Vexia Edu Atla 10 tablet 5V version */
412+
.matches = {
413+
/* Having all 3 of these not set is somewhat unique */
414+
DMI_MATCH(DMI_SYS_VENDOR, "To be filled by O.E.M."),
415+
DMI_MATCH(DMI_PRODUCT_NAME, "To be filled by O.E.M."),
416+
DMI_MATCH(DMI_BOARD_NAME, "To be filled by O.E.M."),
417+
/* Above strings are too generic, also match on BIOS date */
418+
DMI_MATCH(DMI_BIOS_DATE, "05/14/2015"),
419+
},
420+
.driver_data = (void *)(ACPI_QUIRK_SKIP_I2C_CLIENTS |
421+
ACPI_QUIRK_SKIP_ACPI_AC_AND_BATTERY),
422+
},
410423
{
411424
/* Vexia Edu Atla 10 tablet 9V version */
412425
.matches = {

0 commit comments

Comments
 (0)