Skip to content

Commit

Permalink
ACPI: Add quirk for Surface Laptop 4 AMD missing irq 7 override
Browse files Browse the repository at this point in the history
This patch is the work of Thomas Gleixner <tglx@linutronix.de> and is
copied from:
https://lore.kernel.org/lkml/87lf8ddjqx.ffs@nanos.tec.linutronix.de/

This patch adds a quirk to the ACPI setup to patch in the the irq 7 pin
setup that is missing in the laptops ACPI table.

This patch was used for validation of the issue, and is not a proper
fix, but is probably a better temporary hack than continuing to probe
the Legacy PIC and run with the PIC in an unknown state.

Patchset: amd-gpio
  • Loading branch information
nakato authored and qzed committed Sep 5, 2021
1 parent 9bf831f commit 25baf27
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions arch/x86/kernel/acpi/boot.c
Expand Up @@ -22,6 +22,7 @@
#include <linux/efi-bgrt.h>
#include <linux/serial_core.h>
#include <linux/pgtable.h>
#include <linux/dmi.h>

#include <asm/e820/api.h>
#include <asm/irqdomain.h>
Expand Down Expand Up @@ -1143,6 +1144,17 @@ static void __init mp_config_acpi_legacy_irqs(void)
}
}

static const struct dmi_system_id surface_quirk[] __initconst = {
{
.ident = "Microsoft Surface Laptop 4 (AMD)",
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "Microsoft Corporation"),
DMI_MATCH(DMI_PRODUCT_SKU, "Surface_Laptop_4_1952:1953")
},
},
{}
};

/*
* Parse IOAPIC related entries in MADT
* returns 0 on success, < 0 on error
Expand Down Expand Up @@ -1198,6 +1210,11 @@ static int __init acpi_parse_madt_ioapic_entries(void)
acpi_sci_ioapic_setup(acpi_gbl_FADT.sci_interrupt, 0, 0,
acpi_gbl_FADT.sci_interrupt);

if (dmi_check_system(surface_quirk)) {
pr_warn("Surface hack: Override irq 7\n");
mp_override_legacy_irq(7, 3, 3, 7);
}

/* Fill in identity legacy mappings where no override */
mp_config_acpi_legacy_irqs();

Expand Down

0 comments on commit 25baf27

Please sign in to comment.