Skip to contentSkip to conversation

ACPI: resource: Fix regressions from "Remove "Zen" specific match and quirks"

PATCH In review Hans de Goede 4 participants 15 messages Aug 9, 2023 – Aug 10, 2023

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

v3 cover ACPI: resource: Fix regressions from "Remove "Zen" specific match and quirks"

Hi All,

Here is v3 of my series to address the regressions wrt PS/2 IRQs not working on AMD zen models.

Changes in v3:
- Add links to more bug reports caused by a9c4a912b7dc to the commitmsg
- Also do the ZEN check for IRQ 12 (Reported-by August Wikerfors)
- Move the gsi != 1 && gsi != 12 check to inside the #ifdef CONFIG_X86, these being the i8042 IRQs is X86 specific and the "return true;" is always done for #ifndef CONFIG_X86 already
- Make acpi_int_src_ovr an array which keep track of the status of all legacy IRQs and not just IRQ 1

Changes in v2:
- Add 2 patches on top of the revert to avoid the revert causing other models which are known to need the override to regress.

As discussed in the v1 thread:
https://lore.kernel.org/linux-acpi/[email protected]/

This series adds a few fixes on top of the revert to avoid the revert causing regressions on other AMD Zen systems where dropping the special Zen behavior was known to fix things.

As also mentioned in the thread this is intended as a short term fix for 6.4.y >= 6.4.7 and 6.5 to get all the systems which were working fine before commit a9c4a912b7dc ("ACPI: resource: Remove "Zen" specific match and quirks") to work again.

The long term plan is to see if we can read back what the BIOS has actually programmed as IRQ trigger-type / polarity into the IOAPIC.

Regards,

Hans

Hans de Goede (3):
ACPI: resource: revert "Remove "Zen" specific match and quirks"
ACPI: resource: Always use MADT override IRQ settings for all legacy

    non i8042 IRQs

ACPI: resource: Honor MADT INT_SRC_OVR settings for IRQ1 on AMD Zen

 arch/x86/include/asm/acpi.h |  2 ++
 arch/x86/kernel/acpi/boot.c |  4 +++
 drivers/acpi/resource.c     | 52 +++++++++++++++++++++++++++++++++++++
 3 files changed, 58 insertions(+)
Signature · 1 line
2.41.0
#1 lore raw

PATCH v3 1/3 ACPI: resource: revert "Remove "Zen" specific match and quirks"

Commit a9c4a912b7dc ("ACPI: resource: Remove "Zen" specific match and quirks") is causing keyboard problems for quite a log of AMD based laptop users, leading to many bug reports.

Revert this change for now, until we can come up with a better fix for the PS/2 IRQ trigger-type/polarity problems on some x86 laptops.

---
Changes in v3:
- Add links to more bug reports caused by a9c4a912b7dc

---
 drivers/acpi/resource.c | 60 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 60 insertions(+)
drivers/acpi/resource.c +60 -0
index 1dd8d5aebf67..0800a9d77558 100644
@@ -470,6 +470,52 @@ static const struct dmi_system_id asus_laptop[] = {
 	{ }
 };
 
+static const struct dmi_system_id lenovo_laptop[] = {
+	{
+		.ident = "LENOVO IdeaPad Flex 5 14ALC7",
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+			DMI_MATCH(DMI_PRODUCT_NAME, "82R9"),
+		},
+	},
+	{
+		.ident = "LENOVO IdeaPad Flex 5 16ALC7",
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+			DMI_MATCH(DMI_PRODUCT_NAME, "82RA"),
+		},
+	},
+	{ }
+};
+
+static const struct dmi_system_id tongfang_gm_rg[] = {
+	{
+		.ident = "TongFang GMxRGxx/XMG CORE 15 (M22)/TUXEDO Stellaris 15 Gen4 AMD",
+		.matches = {
+			DMI_MATCH(DMI_BOARD_NAME, "GMxRGxx"),
+		},
+	},
+	{ }
+};
+
+static const struct dmi_system_id maingear_laptop[] = {
+	{
+		.ident = "MAINGEAR Vector Pro 2 15",
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "Micro Electronics Inc"),
+			DMI_MATCH(DMI_PRODUCT_NAME, "MG-VCP2-15A3070T"),
+		}
+	},
+	{
+		.ident = "MAINGEAR Vector Pro 2 17",
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "Micro Electronics Inc"),
+			DMI_MATCH(DMI_PRODUCT_NAME, "MG-VCP2-17A3070T"),
+		},
+	},
+	{ }
+};
+
 static const struct dmi_system_id lg_laptop[] = {
 	{
 		.ident = "LG Electronics 17U70P",
@@ -493,6 +539,10 @@ struct irq_override_cmp {
 static const struct irq_override_cmp override_table[] = {
 	{ medion_laptop, 1, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_LOW, 0, false },
 	{ asus_laptop, 1, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_LOW, 0, false },
+	{ lenovo_laptop, 6, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_LOW, 0, true },
+	{ lenovo_laptop, 10, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_LOW, 0, true },
+	{ tongfang_gm_rg, 1, ACPI_EDGE_SENSITIVE, ACPI_ACTIVE_LOW, 1, true },
+	{ maingear_laptop, 1, ACPI_EDGE_SENSITIVE, ACPI_ACTIVE_LOW, 1, true },
 	{ lg_laptop, 1, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_LOW, 0, false },
 };
 
@@ -512,6 +562,16 @@ static bool acpi_dev_irq_override(u32 gsi, u8 triggering, u8 polarity,
 			return entry->override;
 	}
 
+#ifdef CONFIG_X86
+	/*
+	 * IRQ override isn't needed on modern AMD Zen systems and
+	 * this override breaks active low IRQs on AMD Ryzen 6000 and
+	 * newer systems. Skip it.
+	 */
+	if (boot_cpu_has(X86_FEATURE_ZEN))
+		return false;
+#endif
+
 	return true;
 }
 
Signature · 1 line
2.41.0
#2 lore raw

PATCH v3 2/3 ACPI: resource: Always use MADT override IRQ settings for all legacy non i8042 IRQs

In reply to Hans de Goede

All the cases, were the DSDT IRQ settings should be used instead of the MADT override, are for IRQ 1 or 12, the PS/2 kbd resp. mouse IRQs.

Simplify things by always honering the override for other legacy IRQs (for non DMI quirked cases).

This allows removing the DMI quirks to honor the override for some non i8042 IRQs on some AMD ZEN based Lenovo models.

Fixes a9c4a912b7dc ("ACPI: resource: Remove "Zen" specific match and quirks")
Cc Mario Limonciello <[email protected]>
Cc Linux regressions mailing list <[email protected]>

---
Changes in v2:
- Also do the ZEN check for IRQ 12 (Reported-by August Wikerfors)
- Move the gsi != 1 && gsi != 12 check to inside the #ifdef CONFIG_X86, this being the i8042 IRQs is X86 specific and the "return true;" is always done for #ifndef CONFIG_X86 already

---
 drivers/acpi/resource.c | 28 ++++++++--------------------
 1 file changed, 8 insertions(+), 20 deletions(-)
drivers/acpi/resource.c +8 -20
index 0800a9d77558..380cda1e86f4 100644
@@ -470,24 +470,6 @@ static const struct dmi_system_id asus_laptop[] = {
 	{ }
 };
 
-static const struct dmi_system_id lenovo_laptop[] = {
-	{
-		.ident = "LENOVO IdeaPad Flex 5 14ALC7",
-		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "82R9"),
-		},
-	},
-	{
-		.ident = "LENOVO IdeaPad Flex 5 16ALC7",
-		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "82RA"),
-		},
-	},
-	{ }
-};
-
 static const struct dmi_system_id tongfang_gm_rg[] = {
 	{
 		.ident = "TongFang GMxRGxx/XMG CORE 15 (M22)/TUXEDO Stellaris 15 Gen4 AMD",
@@ -539,8 +521,6 @@ struct irq_override_cmp {
 static const struct irq_override_cmp override_table[] = {
 	{ medion_laptop, 1, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_LOW, 0, false },
 	{ asus_laptop, 1, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_LOW, 0, false },
-	{ lenovo_laptop, 6, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_LOW, 0, true },
-	{ lenovo_laptop, 10, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_LOW, 0, true },
 	{ tongfang_gm_rg, 1, ACPI_EDGE_SENSITIVE, ACPI_ACTIVE_LOW, 1, true },
 	{ maingear_laptop, 1, ACPI_EDGE_SENSITIVE, ACPI_ACTIVE_LOW, 1, true },
 	{ lg_laptop, 1, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_LOW, 0, false },
@@ -563,6 +543,14 @@ static bool acpi_dev_irq_override(u32 gsi, u8 triggering, u8 polarity,
 	}
 
 #ifdef CONFIG_X86
+	/*
+	 * Always use the MADT override info, except for the i8042 PS/2 ctrl
+	 * IRQs (1 and 12). For these the DSDT IRQ settings should sometimes
+	 * be used otherwise PS/2 keyboards / mice will not work.
+	 */
+	if (gsi != 1 && gsi != 12)
+		return true;
+
 	/*
 	 * IRQ override isn't needed on modern AMD Zen systems and
 	 * this override breaks active low IRQs on AMD Ryzen 6000 and
Signature · 1 line
2.41.0
#3 lore raw

PATCH v3 3/3 ACPI: resource: Honor MADT INT_SRC_OVR settings for IRQ1 on AMD Zen

In reply to Hans de Goede

On AMD Zen acpi_dev_irq_override() by default prefers the DSDT IRQ 1 settings over the MADT settings.

This causes the keyboard to malfunction on some laptop models (see Links), all models from the Links have an INT_SRC_OVR MADT entry for IRQ 1.

Fixes a9c4a912b7dc ("ACPI: resource: Remove "Zen" specific match and quirks")
Cc Mario Limonciello <[email protected]>
Cc Linux regressions mailing list <[email protected]>

---
Changes in v3:
- Make acpi_int_src_ovr an array which keep track of the status of all legacy IRQs and not just IRQ 1

---
 arch/x86/include/asm/acpi.h | 2 ++
 arch/x86/kernel/acpi/boot.c | 4 ++++
 drivers/acpi/resource.c     | 4 ++++
 3 files changed, 10 insertions(+)
arch/x86/include/asm/acpi.h +2 -0
index 8eb74cf386db..6bc00fddf8dd 100644
@@ -15,6 +15,7 @@
 #include <asm/mpspec.h>
 #include <asm/x86_init.h>
 #include <asm/cpufeature.h>
+#include <asm/irq_vectors.h>
 
 #ifdef CONFIG_ACPI_APEI
 # include <asm/pgtable_types.h>
@@ -31,6 +32,7 @@ extern int acpi_skip_timer_override;
 extern int acpi_use_timer_override;
 extern int acpi_fix_pin2_polarity;
 extern int acpi_disable_cmcff;
+extern int acpi_int_src_ovr[NR_IRQS_LEGACY];
 
 extern u8 acpi_sci_flags;
 extern u32 acpi_sci_override_gsi;
arch/x86/kernel/acpi/boot.c +4 -0
index 21b542a6866c..b88e5e0135ab 100644
@@ -52,6 +52,7 @@ int acpi_lapic;
 int acpi_ioapic;
 int acpi_strict;
 int acpi_disable_cmcff;
+int acpi_int_src_ovr[NR_IRQS_LEGACY];
 
 /* ACPI SCI override configuration */
 u8 acpi_sci_flags __initdata;
@@ -588,6 +589,9 @@ acpi_parse_int_src_ovr(union acpi_subtable_headers * header,
 
 	acpi_table_print_madt_entry(&header->common);
 
+	if (intsrc->source_irq < NR_IRQS_LEGACY)
+		acpi_int_src_ovr[intsrc->source_irq] = 1;
+
 	if (intsrc->source_irq == acpi_gbl_FADT.sci_interrupt) {
 		acpi_sci_ioapic_setup(intsrc->source_irq,
 				      intsrc->inti_flags & ACPI_MADT_POLARITY_MASK,
drivers/acpi/resource.c +4 -0
index 380cda1e86f4..a0bb53868e18 100644
@@ -551,6 +551,10 @@ static bool acpi_dev_irq_override(u32 gsi, u8 triggering, u8 polarity,
 	if (gsi != 1 && gsi != 12)
 		return true;
 
+	/* If the override comes from an INT_SRC_OVR MADT entry honor it */
+	if (acpi_int_src_ovr[gsi])
+		return true;
+
 	/*
 	 * IRQ override isn't needed on modern AMD Zen systems and
 	 * this override breaks active low IRQs on AMD Ryzen 6000 and
Signature · 1 line
2.41.0
#4 lore raw

Re: [PATCH v3 3/3] ACPI: resource: Honor MADT INT_SRC_OVR settings for IRQ1 on AMD Zen

Quoted 6 lines · Hans de Goede

On AMD Zen acpi_dev_irq_override() by default prefers the DSDT IRQ 1 settings over the MADT settings.

This causes the keyboard to malfunction on some laptop models (see Links), all models from the Links have an INT_SRC_OVR MADT entry for IRQ 1.

...

Quoted 1 line

...

arch/x86/kernel/acpi/boot.c int acpi_lapic; · line 55

Quoted 9 lines
arch/x86/kernel/acpi/boot.c +1 -0
index 21b542a6866c..b88e5e0135ab 100644
@@ -52,6 +52,7 @@ int acpi_lapic;
  int acpi_ioapic;
  int acpi_strict;
  int acpi_disable_cmcff;
+int acpi_int_src_ovr[NR_IRQS_LEGACY];

So why not to use bool to make it clear this is not an irq number, but a state?

arch/x86/kernel/acpi/boot.c acpi_parse_int_src_ovr(union acpi_subtable_headers * header, · line 593

Quoted 9 lines
arch/x86/kernel/acpi/boot.c +2 -0
  /* ACPI SCI override configuration */
  u8 acpi_sci_flags __initdata;
@@ -588,6 +589,9 @@ acpi_parse_int_src_ovr(union acpi_subtable_headers * header,
 
  	acpi_table_print_madt_entry(&header->common);
 
+	if (intsrc->source_irq < NR_IRQS_LEGACY)
+		acpi_int_src_ovr[intsrc->source_irq] = 1;

And "true" here.

thanks,

Signature · 2 lines
js
suse labs
#5 lore raw

Re: [PATCH v3 3/3] ACPI: resource: Honor MADT INT_SRC_OVR settings for IRQ1 on AMD Zen

Hi,

Quoted 22 lines · Jiri Slaby
Quoted 6 lines · Hans de Goede

On AMD Zen acpi_dev_irq_override() by default prefers the DSDT IRQ 1 settings over the MADT settings.

This causes the keyboard to malfunction on some laptop models (see Links), all models from the Links have an INT_SRC_OVR MADT entry for IRQ 1.

...

Quoted 1 line

...

arch/x86/kernel/acpi/boot.c int acpi_lapic; · line 55

Quoted 9 lines
arch/x86/kernel/acpi/boot.c +1 -0
index 21b542a6866c..b88e5e0135ab 100644
@@ -52,6 +52,7 @@ int acpi_lapic;
   int acpi_ioapic;
   int acpi_strict;
   int acpi_disable_cmcff;
+int acpi_int_src_ovr[NR_IRQS_LEGACY];

So why not to use bool to make it clear this is not an irq number, but a state?

Quoted 8 lines

arch/x86/kernel/acpi/boot.c acpi_parse_int_src_ovr(union acpi_subtable_headers * header, · line 591

Quoted 6 lines
arch/x86/kernel/acpi/boot.c +1 -0
     /* ACPI SCI override configuration */
   u8 acpi_sci_flags __initdata;
@@ -588,6 +589,9 @@ acpi_parse_int_src_ovr(union acpi_subtable_headers * header,
         acpi_table_print_madt_entry(&header->common);
   +    if (intsrc->source_irq < NR_IRQS_LEGACY)
+        acpi_int_src_ovr[intsrc->source_irq] = 1;

And "true" here.

Ack that would indeed be better.

Rafael, can you fix this up while merging or do you want a v4 series ?

Regards,

Hans

#6 lore raw

Re: [PATCH v3 3/3] ACPI: resource: Honor MADT INT_SRC_OVR settings for IRQ1 on AMD Zen

Quoted 35 lines · Hans de Goede

Hi,

Quoted 22 lines · Jiri Slaby
Quoted 6 lines · Hans de Goede

On AMD Zen acpi_dev_irq_override() by default prefers the DSDT IRQ 1 settings over the MADT settings.

This causes the keyboard to malfunction on some laptop models (see Links), all models from the Links have an INT_SRC_OVR MADT entry for IRQ 1.

...

Quoted 1 line

...

arch/x86/kernel/acpi/boot.c int acpi_lapic; · line 55

Quoted 9 lines
arch/x86/kernel/acpi/boot.c +1 -0
index 21b542a6866c..b88e5e0135ab 100644
@@ -52,6 +52,7 @@ int acpi_lapic;
  int acpi_ioapic;
  int acpi_strict;
  int acpi_disable_cmcff;
+int acpi_int_src_ovr[NR_IRQS_LEGACY];

So why not to use bool to make it clear this is not an irq number, but a state?

Quoted 8 lines

arch/x86/kernel/acpi/boot.c acpi_parse_int_src_ovr(union acpi_subtable_headers * header, · line 591

Quoted 6 lines
arch/x86/kernel/acpi/boot.c +1 -0
    /* ACPI SCI override configuration */
  u8 acpi_sci_flags __initdata;
@@ -588,6 +589,9 @@ acpi_parse_int_src_ovr(union acpi_subtable_headers * header,
        acpi_table_print_madt_entry(&header->common);
  +    if (intsrc->source_irq < NR_IRQS_LEGACY)
+        acpi_int_src_ovr[intsrc->source_irq] = 1;

And "true" here.

Quoted 3 lines

Ack that would indeed be better.

Rafael, can you fix this up while merging or do you want a v4 series ?

I think I can do that.

#7 lore raw

Re: [PATCH v3 3/3] ACPI: resource: Honor MADT INT_SRC_OVR settings for IRQ1 on AMD Zen

Hi,

Quoted 36 lines · Rafael J. Wysocki
Quoted 35 lines · Hans de Goede

Hi,

Quoted 30 lines · Jiri Slaby
Quoted 6 lines · Hans de Goede

On AMD Zen acpi_dev_irq_override() by default prefers the DSDT IRQ 1 settings over the MADT settings.

This causes the keyboard to malfunction on some laptop models (see Links), all models from the Links have an INT_SRC_OVR MADT entry for IRQ 1.

...

Quoted 1 line

...

arch/x86/kernel/acpi/boot.c int acpi_lapic; · line 55

Quoted 9 lines
arch/x86/kernel/acpi/boot.c +1 -0
index 21b542a6866c..b88e5e0135ab 100644
@@ -52,6 +52,7 @@ int acpi_lapic;
  int acpi_ioapic;
  int acpi_strict;
  int acpi_disable_cmcff;
+int acpi_int_src_ovr[NR_IRQS_LEGACY];

So why not to use bool to make it clear this is not an irq number, but a state?

arch/x86/kernel/acpi/boot.c acpi_parse_int_src_ovr(union acpi_subtable_headers * header, · line 591

Quoted 6 lines
arch/x86/kernel/acpi/boot.c +1 -0
    /* ACPI SCI override configuration */
  u8 acpi_sci_flags __initdata;
@@ -588,6 +589,9 @@ acpi_parse_int_src_ovr(union acpi_subtable_headers * header,
        acpi_table_print_madt_entry(&header->common);
  +    if (intsrc->source_irq < NR_IRQS_LEGACY)
+        acpi_int_src_ovr[intsrc->source_irq] = 1;

And "true" here.

Quoted 5 lines
Quoted 3 lines

Ack that would indeed be better.

Rafael, can you fix this up while merging or do you want a v4 series ?

I think I can do that.

Great, thank you.

Do you have any comments on this series, or is this ready for merging now?

Regards,

Hans

#8 lore raw

Re: [PATCH v3 3/3] ACPI: resource: Honor MADT INT_SRC_OVR settings for IRQ1 on AMD Zen

Quoted 42 lines · Hans de Goede

Hi,

Quoted 38 lines · Rafael J. Wysocki
Quoted 37 lines · Hans de Goede

Hi,

Quoted 22 lines · Jiri Slaby
Quoted 6 lines · Hans de Goede

On AMD Zen acpi_dev_irq_override() by default prefers the DSDT IRQ 1 settings over the MADT settings.

This causes the keyboard to malfunction on some laptop models (see Links), all models from the Links have an INT_SRC_OVR MADT entry for IRQ 1.

...

Quoted 1 line

...

arch/x86/kernel/acpi/boot.c int acpi_lapic; · line 55

Quoted 9 lines
arch/x86/kernel/acpi/boot.c +1 -0
index 21b542a6866c..b88e5e0135ab 100644
@@ -52,6 +52,7 @@ int acpi_lapic;
  int acpi_ioapic;
  int acpi_strict;
  int acpi_disable_cmcff;
+int acpi_int_src_ovr[NR_IRQS_LEGACY];

So why not to use bool to make it clear this is not an irq number, but a state?

Quoted 8 lines

arch/x86/kernel/acpi/boot.c acpi_parse_int_src_ovr(union acpi_subtable_headers * header, · line 591

Quoted 6 lines
arch/x86/kernel/acpi/boot.c +1 -0
    /* ACPI SCI override configuration */
  u8 acpi_sci_flags __initdata;
@@ -588,6 +589,9 @@ acpi_parse_int_src_ovr(union acpi_subtable_headers * header,
        acpi_table_print_madt_entry(&header->common);
  +    if (intsrc->source_irq < NR_IRQS_LEGACY)
+        acpi_int_src_ovr[intsrc->source_irq] = 1;

And "true" here.

Ack that would indeed be better.

Quoted 7 lines
Quoted 3 lines
Quoted 1 line

Rafael, can you fix this up while merging or do you want a v4 series ?

I think I can do that.

Great, thank you.

Do you have any comments on this series, or is this ready for merging now?

I've applied this series as 6.5-rc6 material and made the change discussed above.

It has been added to my linux-next branch too.

Thanks!

#9 lore raw

Re: [PATCH v3 3/3] ACPI: resource: Honor MADT INT_SRC_OVR settings for IRQ1 on AMD Zen

In reply to Hans de Goede
Quoted 7 lines · Hans de Goede

On AMD Zen acpi_dev_irq_override() by default prefers the DSDT IRQ 1 settings over the MADT settings.

This causes the keyboard to malfunction on some laptop models (see Links), all models from the Links have an INT_SRC_OVR MADT entry for IRQ 1.

Quoted 8 lines
Fixes a9c4a912b7dc ("ACPI: resource: Remove "Zen" specific match and quirks")
Cc Mario Limonciello <[email protected]>
Cc Linux regressions mailing list <[email protected]>

One of the laptops fixed by a9c4a912b7dc, PCSpecialist Elimina Pro 16 M [1], seems to have no INT_SRC_OVR entry for IRQ 1 [2]:

Quoted 2 lines
[    0.084265] ACPI: INT_SRC_OVR (bus 0 bus_irq 0 global_irq 2 dfl dfl)
[    0.084266] ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 9 low level)

I'm not sure if it was IRQ 1 that needed to be overridden for that model though, so it may work anyway with patch 2 of this series.

[1] https://bugzilla.kernel.org/show_bug.cgi?id=217394#c18
[2] https://bugzilla.kernel.org/attachment.cgi?id=304338

Regards,
August Wikerfors

#10 lore raw

Re: [PATCH v3 3/3] ACPI: resource: Honor MADT INT_SRC_OVR settings for IRQ1 on AMD Zen

Hi,

Quoted 19 lines · August Wikerfors
Quoted 7 lines · Hans de Goede

On AMD Zen acpi_dev_irq_override() by default prefers the DSDT IRQ 1 settings over the MADT settings.

This causes the keyboard to malfunction on some laptop models (see Links), all models from the Links have an INT_SRC_OVR MADT entry for IRQ 1.

Quoted 8 lines
Fixes a9c4a912b7dc ("ACPI: resource: Remove "Zen" specific match and quirks")
Cc Mario Limonciello <[email protected]>
Cc Linux regressions mailing list <[email protected]>

One of the laptops fixed by a9c4a912b7dc, PCSpecialist Elimina Pro 16 M [1], seems to have no INT_SRC_OVR entry for IRQ 1 [2]:

Quoted 7 lines
Quoted 2 lines

[    0.084265] ACPI: INT_SRC_OVR (bus 0 bus_irq 0 global_irq 2 dfl dfl) [    0.084266] ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 9 low level)

I'm not sure if it was IRQ 1 that needed to be overridden for that model though, so it may work anyway with patch 2 of this series.

[1] https://bugzilla.kernel.org/show_bug.cgi?id=217394#c18
[2] https://bugzilla.kernel.org/attachment.cgi?id=304338

Good catch, thanks. So it looks like this one needs a DMI quirk (until we have a better generic solution.

I'll reach out to the reporter and ask for dmidecode output and prepare a follow-up patch. Still I think that we should move forward with this series to fix the 6 bugs which are linked to from PAtch 1's commitmsg and those are likely just the top of the iceberg.

Regards,

Hans

#11 lore raw

Re: [PATCH v3 3/3] ACPI: resource: Honor MADT INT_SRC_OVR settings for IRQ1 on AMD Zen

Quoted 28 lines · Hans de Goede

Hi,

Quoted 24 lines · August Wikerfors
Quoted 7 lines · Hans de Goede

On AMD Zen acpi_dev_irq_override() by default prefers the DSDT IRQ 1 settings over the MADT settings.

This causes the keyboard to malfunction on some laptop models (see Links), all models from the Links have an INT_SRC_OVR MADT entry for IRQ 1.

Quoted 8 lines
Fixes a9c4a912b7dc ("ACPI: resource: Remove "Zen" specific match and quirks")
Cc Mario Limonciello <[email protected]>
Cc Linux regressions mailing list <[email protected]>

One of the laptops fixed by a9c4a912b7dc, PCSpecialist Elimina Pro 16 M [1], seems to have no INT_SRC_OVR entry for IRQ 1 [2]:

Quoted 2 lines
[    0.084265] ACPI: INT_SRC_OVR (bus 0 bus_irq 0 global_irq 2 dfl dfl)
[    0.084266] ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 9 low level)

I'm not sure if it was IRQ 1 that needed to be overridden for that model though, so it may work anyway with patch 2 of this series.

Quoted 8 lines
Quoted 2 lines

[1] https://bugzilla.kernel.org/show_bug.cgi?id=217394#c18
[2] https://bugzilla.kernel.org/attachment.cgi?id=304338

Good catch, thanks. So it looks like this one needs a DMI quirk (until we have a better generic solution.

I'll reach out to the reporter and ask for dmidecode output and prepare a follow-up patch. Still I think that we should move forward with this series to fix the 6 bugs which are linked to from PAtch 1's commitmsg and those are likely just the top of the iceberg.

You are probably right, but it would be good to get a fix for this ASAP, as I would prefer it to go in along with the series, if possible.

#12 lore raw

Re: [PATCH v3 3/3] ACPI: resource: Honor MADT INT_SRC_OVR settings for IRQ1 on AMD Zen

Hi,

Quoted 34 lines · Rafael J. Wysocki
Quoted 33 lines · Hans de Goede

Hi,

Quoted 19 lines · August Wikerfors
Quoted 7 lines · Hans de Goede

On AMD Zen acpi_dev_irq_override() by default prefers the DSDT IRQ 1 settings over the MADT settings.

This causes the keyboard to malfunction on some laptop models (see Links), all models from the Links have an INT_SRC_OVR MADT entry for IRQ 1.

Quoted 8 lines
Fixes a9c4a912b7dc ("ACPI: resource: Remove "Zen" specific match and quirks")
Cc Mario Limonciello <[email protected]>
Cc Linux regressions mailing list <[email protected]>

One of the laptops fixed by a9c4a912b7dc, PCSpecialist Elimina Pro 16 M [1], seems to have no INT_SRC_OVR entry for IRQ 1 [2]:

Quoted 7 lines
Quoted 2 lines
[    0.084265] ACPI: INT_SRC_OVR (bus 0 bus_irq 0 global_irq 2 dfl dfl)
[    0.084266] ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 9 low level)

I'm not sure if it was IRQ 1 that needed to be overridden for that model though, so it may work anyway with patch 2 of this series.

[1] https://bugzilla.kernel.org/show_bug.cgi?id=217394#c18
[2] https://bugzilla.kernel.org/attachment.cgi?id=304338

Good catch, thanks. So it looks like this one needs a DMI quirk (until we have a better generic solution.

Quoted 7 lines
Quoted 3 lines

I'll reach out to the reporter and ask for dmidecode output and prepare a follow-up patch. Still I think that we should move forward with this series to fix the 6 bugs which are linked to from PAtch 1's commitmsg and those are likely just the top of the iceberg.

You are probably right, but it would be good to get a fix for this ASAP, as I would prefer it to go in along with the series, if possible.

Agreed I've asked in the bugzilla for dmidecode output for the laptop model in question (I checked https://linux-hardware.org/ and it does not have this model).

As soon as I've dmidecode info I'll prepare the follow-up patch as well as a Fedora kernel with the entire series + qurik patch for the reporter to test.

Regards,

Hans

#13 lore raw

Re: [PATCH v3 3/3] ACPI: resource: Honor MADT INT_SRC_OVR settings for IRQ1 on AMD Zen

Hi,

Quoted 41 lines · Hans de Goede

Hi,

Quoted 38 lines · Rafael J. Wysocki
Quoted 36 lines · Hans de Goede

Hi,

Quoted 19 lines · August Wikerfors
Quoted 7 lines · Hans de Goede

On AMD Zen acpi_dev_irq_override() by default prefers the DSDT IRQ 1 settings over the MADT settings.

This causes the keyboard to malfunction on some laptop models (see Links), all models from the Links have an INT_SRC_OVR MADT entry for IRQ 1.

Quoted 8 lines
Fixes a9c4a912b7dc ("ACPI: resource: Remove "Zen" specific match and quirks")
Cc Mario Limonciello <[email protected]>
Cc Linux regressions mailing list <[email protected]>

One of the laptops fixed by a9c4a912b7dc, PCSpecialist Elimina Pro 16 M [1], seems to have no INT_SRC_OVR entry for IRQ 1 [2]:

Quoted 7 lines
Quoted 2 lines
[    0.084265] ACPI: INT_SRC_OVR (bus 0 bus_irq 0 global_irq 2 dfl dfl)
[    0.084266] ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 9 low level)

I'm not sure if it was IRQ 1 that needed to be overridden for that model though, so it may work anyway with patch 2 of this series.

[1] https://bugzilla.kernel.org/show_bug.cgi?id=217394#c18
[2] https://bugzilla.kernel.org/attachment.cgi?id=304338

Good catch, thanks. So it looks like this one needs a DMI quirk (until we have a better generic solution.

I'll reach out to the reporter and ask for dmidecode output and prepare a follow-up patch. Still I think that we should move forward with this series to fix the 6 bugs which are linked to from PAtch 1's commitmsg and those are likely just the top of the iceberg.

Quoted 7 lines
Quoted 3 lines

You are probably right, but it would be good to get a fix for this ASAP, as I would prefer it to go in along with the series, if possible.

Agreed I've asked in the bugzilla for dmidecode output for the laptop model in question (I checked https://linux-hardware.org/ and it does not have this model).

As soon as I've dmidecode info I'll prepare the follow-up patch as well as a Fedora kernel with the entire series + qurik patch for the reporter to test.

I have just send out the follow up patch with the DMI quirk:

https://lore.kernel.org/linux-acpi/[email protected]/

And I have started a Fedora kernel test build with this series + the quirk for the reporter to test:

https://bugzilla.kernel.org/show_bug.cgi?id=217394#c33

Regards,

Hans

Tested-by on the v3 series
#14 lore raw
In reply to Hans de Goede
Quoted 41 lines · Hans de Goede

Hi All,

Here is v3 of my series to address the regressions wrt PS/2 IRQs not working on AMD zen models.

Changes in v3:
- Add links to more bug reports caused by a9c4a912b7dc to the commitmsg
- Also do the ZEN check for IRQ 12 (Reported-by August Wikerfors)
- Move the gsi != 1 && gsi != 12 check to inside the #ifdef CONFIG_X86, these being the i8042 IRQs is X86 specific and the "return true;" is always done for #ifndef CONFIG_X86 already
- Make acpi_int_src_ovr an array which keep track of the status of all legacy IRQs and not just IRQ 1

Changes in v2:
- Add 2 patches on top of the revert to avoid the revert causing other models which are known to need the override to regress.

As discussed in the v1 thread:
https://lore.kernel.org/linux-acpi/[email protected]/

This series adds a few fixes on top of the revert to avoid the revert causing regressions on other AMD Zen systems where dropping the special Zen behavior was known to fix things.

As also mentioned in the thread this is intended as a short term fix for 6.4.y >= 6.4.7 and 6.5 to get all the systems which were working fine before commit a9c4a912b7dc ("ACPI: resource: Remove "Zen" specific match and quirks") to work again.

The long term plan is to see if we can read back what the BIOS has actually programmed as IRQ trigger-type / polarity into the IOAPIC.

Regards,

Hans

Hans de Goede (3):
ACPI: resource: revert "Remove "Zen" specific match and quirks"
ACPI: resource: Always use MADT override IRQ settings for all legacy

Quoted 8 lines
     non i8042 IRQs

ACPI: resource: Honor MADT INT_SRC_OVR settings for IRQ1 on AMD Zen

  arch/x86/include/asm/acpi.h |  2 ++
  arch/x86/kernel/acpi/boot.c |  4 +++
  drivers/acpi/resource.c     | 52 +++++++++++++++++++++++++++++++++++++
  3 files changed, 58 insertions(+)

Thanks, I can confirm that this series fixes the regression caused by a9c4a912b7dc on Lenovo Yoga 7 14ARB7.

If relevant,

Regards,
August Wikerfors