0013-amd-gpio.patch 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. From 04069751b144350632ec45b5b25c2cc01d5f34ef Mon Sep 17 00:00:00 2001
  2. From: Sachi King <nakato@nakato.io>
  3. Date: Sat, 29 May 2021 17:47:38 +1000
  4. Subject: [PATCH] ACPI: Add quirk for Surface Laptop 4 AMD missing irq 7
  5. override
  6. This patch is the work of Thomas Gleixner <tglx@linutronix.de> and is
  7. copied from:
  8. https://lore.kernel.org/lkml/87lf8ddjqx.ffs@nanos.tec.linutronix.de/
  9. This patch adds a quirk to the ACPI setup to patch in the the irq 7 pin
  10. setup that is missing in the laptops ACPI table.
  11. This patch was used for validation of the issue, and is not a proper
  12. fix, but is probably a better temporary hack than continuing to probe
  13. the Legacy PIC and run with the PIC in an unknown state.
  14. Patchset: amd-gpio
  15. ---
  16. arch/x86/kernel/acpi/boot.c | 17 +++++++++++++++++
  17. 1 file changed, 17 insertions(+)
  18. diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c
  19. index 85a3ce2a3666..2c0e04a3a697 100644
  20. --- a/arch/x86/kernel/acpi/boot.c
  21. +++ b/arch/x86/kernel/acpi/boot.c
  22. @@ -22,6 +22,7 @@
  23. #include <linux/efi-bgrt.h>
  24. #include <linux/serial_core.h>
  25. #include <linux/pgtable.h>
  26. +#include <linux/dmi.h>
  27. #include <asm/e820/api.h>
  28. #include <asm/irqdomain.h>
  29. @@ -1251,6 +1252,17 @@ static void __init mp_config_acpi_legacy_irqs(void)
  30. }
  31. }
  32. +static const struct dmi_system_id surface_quirk[] __initconst = {
  33. + {
  34. + .ident = "Microsoft Surface Laptop 4 (AMD)",
  35. + .matches = {
  36. + DMI_MATCH(DMI_SYS_VENDOR, "Microsoft Corporation"),
  37. + DMI_MATCH(DMI_PRODUCT_SKU, "Surface_Laptop_4_1952:1953")
  38. + },
  39. + },
  40. + {}
  41. +};
  42. +
  43. /*
  44. * Parse IOAPIC related entries in MADT
  45. * returns 0 on success, < 0 on error
  46. @@ -1306,6 +1318,11 @@ static int __init acpi_parse_madt_ioapic_entries(void)
  47. acpi_sci_ioapic_setup(acpi_gbl_FADT.sci_interrupt, 0, 0,
  48. acpi_gbl_FADT.sci_interrupt);
  49. + if (dmi_check_system(surface_quirk)) {
  50. + pr_warn("Surface hack: Override irq 7\n");
  51. + mp_override_legacy_irq(7, 3, 3, 7);
  52. + }
  53. +
  54. /* Fill in identity legacy mappings where no override */
  55. mp_config_acpi_legacy_irqs();
  56. --
  57. 2.43.0
  58. From 8e2f2b852776fca1dd0ab8728be2303051cb19e1 Mon Sep 17 00:00:00 2001
  59. From: Maximilian Luz <luzmaximilian@gmail.com>
  60. Date: Thu, 3 Jun 2021 14:04:26 +0200
  61. Subject: [PATCH] ACPI: Add AMD 13" Surface Laptop 4 model to irq 7 override
  62. quirk
  63. The 13" version of the Surface Laptop 4 has the same problem as the 15"
  64. version, but uses a different SKU. Add that SKU to the quirk as well.
  65. Patchset: amd-gpio
  66. ---
  67. arch/x86/kernel/acpi/boot.c | 9 ++++++++-
  68. 1 file changed, 8 insertions(+), 1 deletion(-)
  69. diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c
  70. index 2c0e04a3a697..b0e1dab3d2ec 100644
  71. --- a/arch/x86/kernel/acpi/boot.c
  72. +++ b/arch/x86/kernel/acpi/boot.c
  73. @@ -1254,12 +1254,19 @@ static void __init mp_config_acpi_legacy_irqs(void)
  74. static const struct dmi_system_id surface_quirk[] __initconst = {
  75. {
  76. - .ident = "Microsoft Surface Laptop 4 (AMD)",
  77. + .ident = "Microsoft Surface Laptop 4 (AMD 15\")",
  78. .matches = {
  79. DMI_MATCH(DMI_SYS_VENDOR, "Microsoft Corporation"),
  80. DMI_MATCH(DMI_PRODUCT_SKU, "Surface_Laptop_4_1952:1953")
  81. },
  82. },
  83. + {
  84. + .ident = "Microsoft Surface Laptop 4 (AMD 13\")",
  85. + .matches = {
  86. + DMI_MATCH(DMI_SYS_VENDOR, "Microsoft Corporation"),
  87. + DMI_MATCH(DMI_PRODUCT_SKU, "Surface_Laptop_4_1958:1959")
  88. + },
  89. + },
  90. {}
  91. };
  92. --
  93. 2.43.0