Skip to content

Commit 29d99aa

Browse files
committed
Merge tag 'acpi-6.5-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull ACPI fixes from Rafael Wysocki: "Rework the handling of interrupt overrides on AMD Zen-based machines to avoid recently introduced regressions (Hans de Goede). Note that this is intended as a short-term mitigation for 6.5 and the long-term approach will be to attempt to use the configuration left by the BIOS, but it requires more investigation" * tag 'acpi-6.5-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: ACPI: resource: Add IRQ override quirk for PCSpecialist Elimina Pro 16 M ACPI: resource: Honor MADT INT_SRC_OVR settings for IRQ1 on AMD Zen ACPI: resource: Always use MADT override IRQ settings for all legacy non i8042 IRQs ACPI: resource: revert "Remove "Zen" specific match and quirks"
2 parents 9578b04 + 56fec00 commit 29d99aa

File tree

3 files changed

+70
-0
lines changed

3 files changed

+70
-0
lines changed

arch/x86/include/asm/acpi.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#include <asm/mpspec.h>
1616
#include <asm/x86_init.h>
1717
#include <asm/cpufeature.h>
18+
#include <asm/irq_vectors.h>
1819

1920
#ifdef CONFIG_ACPI_APEI
2021
# include <asm/pgtable_types.h>
@@ -31,6 +32,7 @@ extern int acpi_skip_timer_override;
3132
extern int acpi_use_timer_override;
3233
extern int acpi_fix_pin2_polarity;
3334
extern int acpi_disable_cmcff;
35+
extern bool acpi_int_src_ovr[NR_IRQS_LEGACY];
3436

3537
extern u8 acpi_sci_flags;
3638
extern u32 acpi_sci_override_gsi;

arch/x86/kernel/acpi/boot.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ int acpi_lapic;
5252
int acpi_ioapic;
5353
int acpi_strict;
5454
int acpi_disable_cmcff;
55+
bool acpi_int_src_ovr[NR_IRQS_LEGACY];
5556

5657
/* ACPI SCI override configuration */
5758
u8 acpi_sci_flags __initdata;
@@ -588,6 +589,9 @@ acpi_parse_int_src_ovr(union acpi_subtable_headers * header,
588589

589590
acpi_table_print_madt_entry(&header->common);
590591

592+
if (intsrc->source_irq < NR_IRQS_LEGACY)
593+
acpi_int_src_ovr[intsrc->source_irq] = true;
594+
591595
if (intsrc->source_irq == acpi_gbl_FADT.sci_interrupt) {
592596
acpi_sci_ioapic_setup(intsrc->source_irq,
593597
intsrc->inti_flags & ACPI_MADT_POLARITY_MASK,

drivers/acpi/resource.c

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -470,6 +470,45 @@ static const struct dmi_system_id asus_laptop[] = {
470470
{ }
471471
};
472472

473+
static const struct dmi_system_id tongfang_gm_rg[] = {
474+
{
475+
.ident = "TongFang GMxRGxx/XMG CORE 15 (M22)/TUXEDO Stellaris 15 Gen4 AMD",
476+
.matches = {
477+
DMI_MATCH(DMI_BOARD_NAME, "GMxRGxx"),
478+
},
479+
},
480+
{ }
481+
};
482+
483+
static const struct dmi_system_id maingear_laptop[] = {
484+
{
485+
.ident = "MAINGEAR Vector Pro 2 15",
486+
.matches = {
487+
DMI_MATCH(DMI_SYS_VENDOR, "Micro Electronics Inc"),
488+
DMI_MATCH(DMI_PRODUCT_NAME, "MG-VCP2-15A3070T"),
489+
}
490+
},
491+
{
492+
.ident = "MAINGEAR Vector Pro 2 17",
493+
.matches = {
494+
DMI_MATCH(DMI_SYS_VENDOR, "Micro Electronics Inc"),
495+
DMI_MATCH(DMI_PRODUCT_NAME, "MG-VCP2-17A3070T"),
496+
},
497+
},
498+
{ }
499+
};
500+
501+
static const struct dmi_system_id pcspecialist_laptop[] = {
502+
{
503+
.ident = "PCSpecialist Elimina Pro 16 M",
504+
.matches = {
505+
DMI_MATCH(DMI_SYS_VENDOR, "PCSpecialist"),
506+
DMI_MATCH(DMI_PRODUCT_NAME, "Elimina Pro 16 M"),
507+
},
508+
},
509+
{ }
510+
};
511+
473512
static const struct dmi_system_id lg_laptop[] = {
474513
{
475514
.ident = "LG Electronics 17U70P",
@@ -493,6 +532,9 @@ struct irq_override_cmp {
493532
static const struct irq_override_cmp override_table[] = {
494533
{ medion_laptop, 1, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_LOW, 0, false },
495534
{ asus_laptop, 1, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_LOW, 0, false },
535+
{ tongfang_gm_rg, 1, ACPI_EDGE_SENSITIVE, ACPI_ACTIVE_LOW, 1, true },
536+
{ maingear_laptop, 1, ACPI_EDGE_SENSITIVE, ACPI_ACTIVE_LOW, 1, true },
537+
{ pcspecialist_laptop, 1, ACPI_EDGE_SENSITIVE, ACPI_ACTIVE_LOW, 1, true },
496538
{ lg_laptop, 1, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_LOW, 0, false },
497539
};
498540

@@ -512,6 +554,28 @@ static bool acpi_dev_irq_override(u32 gsi, u8 triggering, u8 polarity,
512554
return entry->override;
513555
}
514556

557+
#ifdef CONFIG_X86
558+
/*
559+
* Always use the MADT override info, except for the i8042 PS/2 ctrl
560+
* IRQs (1 and 12). For these the DSDT IRQ settings should sometimes
561+
* be used otherwise PS/2 keyboards / mice will not work.
562+
*/
563+
if (gsi != 1 && gsi != 12)
564+
return true;
565+
566+
/* If the override comes from an INT_SRC_OVR MADT entry, honor it. */
567+
if (acpi_int_src_ovr[gsi])
568+
return true;
569+
570+
/*
571+
* IRQ override isn't needed on modern AMD Zen systems and
572+
* this override breaks active low IRQs on AMD Ryzen 6000 and
573+
* newer systems. Skip it.
574+
*/
575+
if (boot_cpu_has(X86_FEATURE_ZEN))
576+
return false;
577+
#endif
578+
515579
return true;
516580
}
517581

0 commit comments

Comments
 (0)