0014-amd-gpio.patch 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. From d259acfe5ae92dee7a87903b9ec114707d32a887 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 9fa321a95eb3..8914a922be2b 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 <xen/xen.h>
  28. @@ -1171,6 +1172,17 @@ static void __init mp_config_acpi_legacy_irqs(void)
  29. }
  30. }
  31. +static const struct dmi_system_id surface_quirk[] __initconst = {
  32. + {
  33. + .ident = "Microsoft Surface Laptop 4 (AMD)",
  34. + .matches = {
  35. + DMI_MATCH(DMI_SYS_VENDOR, "Microsoft Corporation"),
  36. + DMI_MATCH(DMI_PRODUCT_SKU, "Surface_Laptop_4_1952:1953")
  37. + },
  38. + },
  39. + {}
  40. +};
  41. +
  42. /*
  43. * Parse IOAPIC related entries in MADT
  44. * returns 0 on success, < 0 on error
  45. @@ -1227,6 +1239,11 @@ static int __init acpi_parse_madt_ioapic_entries(void)
  46. acpi_sci_ioapic_setup(acpi_gbl_FADT.sci_interrupt, 0, 0,
  47. acpi_gbl_FADT.sci_interrupt);
  48. + if (dmi_check_system(surface_quirk)) {
  49. + pr_warn("Surface hack: Override irq 7\n");
  50. + mp_override_legacy_irq(7, 3, 3, 7);
  51. + }
  52. +
  53. /* Fill in identity legacy mappings where no override */
  54. mp_config_acpi_legacy_irqs();
  55. --
  56. 2.50.0
  57. From 45731a8b193e36dfe5987a635bb69088dc9cc4b6 Mon Sep 17 00:00:00 2001
  58. From: Maximilian Luz <luzmaximilian@gmail.com>
  59. Date: Thu, 3 Jun 2021 14:04:26 +0200
  60. Subject: [PATCH] ACPI: Add AMD 13" Surface Laptop 4 model to irq 7 override
  61. quirk
  62. The 13" version of the Surface Laptop 4 has the same problem as the 15"
  63. version, but uses a different SKU. Add that SKU to the quirk as well.
  64. Patchset: amd-gpio
  65. ---
  66. arch/x86/kernel/acpi/boot.c | 9 ++++++++-
  67. 1 file changed, 8 insertions(+), 1 deletion(-)
  68. diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c
  69. index 8914a922be2b..c43d0a553867 100644
  70. --- a/arch/x86/kernel/acpi/boot.c
  71. +++ b/arch/x86/kernel/acpi/boot.c
  72. @@ -1174,12 +1174,19 @@ static void __init mp_config_acpi_legacy_irqs(void)
  73. static const struct dmi_system_id surface_quirk[] __initconst = {
  74. {
  75. - .ident = "Microsoft Surface Laptop 4 (AMD)",
  76. + .ident = "Microsoft Surface Laptop 4 (AMD 15\")",
  77. .matches = {
  78. DMI_MATCH(DMI_SYS_VENDOR, "Microsoft Corporation"),
  79. DMI_MATCH(DMI_PRODUCT_SKU, "Surface_Laptop_4_1952:1953")
  80. },
  81. },
  82. + {
  83. + .ident = "Microsoft Surface Laptop 4 (AMD 13\")",
  84. + .matches = {
  85. + DMI_MATCH(DMI_SYS_VENDOR, "Microsoft Corporation"),
  86. + DMI_MATCH(DMI_PRODUCT_SKU, "Surface_Laptop_4_1958:1959")
  87. + },
  88. + },
  89. {}
  90. };
  91. --
  92. 2.50.0