distribution/packages/kernel/linux/patches/AMD64/007-add-irq-override-quirks.patch

49 lines
1.6 KiB
Diff
Raw Normal View History

diff -rupN linux-6.1.27.orig/drivers/acpi/resource.c linux-6.1.27/drivers/acpi/resource.c
--- linux-6.1.27.orig/drivers/acpi/resource.c 2023-05-01 20:39:27.376399763 +0000
+++ linux-6.1.27/drivers/acpi/resource.c 2023-05-07 11:02:03.154416724 +0000
@@ -36,6 +36,28 @@ static inline bool
2023-05-07 10:25:09 +00:00
acpi_iospace_resource_valid(struct resource *res) { return true; }
#endif
+#ifdef CONFIG_X86
2023-05-07 10:25:09 +00:00
+/* Enable a quirk to allow override on some AMD 6800 series devices */
+static bool needs_irq_override = false;
+
+static int __init irq_override_fixup(const struct dmi_system_id *id)
+{
+ needs_irq_override = true;
+ return 1;
+}
+
+static const struct dmi_system_id resource_quirk_table[] __initconst = {
+ {
+ .matches = {
+ DMI_EXACT_MATCH(DMI_SYS_VENDOR, "AYANEO"),
+ DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "AIR Plus"),
2023-05-07 10:25:09 +00:00
+ },
+ .callback = irq_override_fixup,
+ },
+ { }
+};
+#endif
2023-05-07 10:25:09 +00:00
+
#if IS_ENABLED(CONFIG_ACPI_GENERIC_GSI)
static inline bool is_gsi(struct acpi_resource_extended_irq *ext_irq)
{
@@ -542,7 +564,9 @@ static bool acpi_dev_irq_override(u32 gs
2023-05-07 10:25:09 +00:00
* this override breaks active low IRQs on AMD Ryzen 6000 and
* newer systems. Skip it.
*/
- if (boot_cpu_has(X86_FEATURE_ZEN))
2023-05-07 10:25:09 +00:00
+ dmi_check_system(resource_quirk_table);
+ if (boot_cpu_has(X86_FEATURE_ZEN) &&
+ needs_irq_override == false)
return false;
#endif
@@ -963,3 +987,4 @@ struct acpi_device *acpi_resource_consum
2023-05-07 10:25:09 +00:00
acpi_get_devices(NULL, acpi_res_consumer_cb, res, (void **) &consumer);
return consumer;
}
+