blacklist.c 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. // SPDX-License-Identifier: GPL-2.0-or-later
  2. /*
  3. * blacklist.c
  4. *
  5. * Check to see if the given machine has a known bad ACPI BIOS
  6. * or if the BIOS is too old.
  7. * Check given machine against acpi_rev_dmi_table[].
  8. *
  9. * Copyright (C) 2004 Len Brown <[email protected]>
  10. * Copyright (C) 2002 Andy Grover <[email protected]>
  11. */
  12. #define pr_fmt(fmt) "ACPI: " fmt
  13. #include <linux/kernel.h>
  14. #include <linux/init.h>
  15. #include <linux/acpi.h>
  16. #include <linux/dmi.h>
  17. #include "internal.h"
  18. #ifdef CONFIG_DMI
  19. static const struct dmi_system_id acpi_rev_dmi_table[] __initconst;
  20. #endif
  21. /*
  22. * POLICY: If *anything* doesn't work, put it on the blacklist.
  23. * If they are critical errors, mark it critical, and abort driver load.
  24. */
  25. static struct acpi_platform_list acpi_blacklist[] __initdata = {
  26. /* Compaq Presario 1700 */
  27. {"PTLTD ", " DSDT ", 0x06040000, ACPI_SIG_DSDT, less_than_or_equal,
  28. "Multiple problems", 1},
  29. /* Sony FX120, FX140, FX150? */
  30. {"SONY ", "U0 ", 0x20010313, ACPI_SIG_DSDT, less_than_or_equal,
  31. "ACPI driver problem", 1},
  32. /* Compaq Presario 800, Insyde BIOS */
  33. {"INT440", "SYSFexxx", 0x00001001, ACPI_SIG_DSDT, less_than_or_equal,
  34. "Does not use _REG to protect EC OpRegions", 1},
  35. /* IBM 600E - _ADR should return 7, but it returns 1 */
  36. {"IBM ", "TP600E ", 0x00000105, ACPI_SIG_DSDT, less_than_or_equal,
  37. "Incorrect _ADR", 1},
  38. { }
  39. };
  40. int __init acpi_blacklisted(void)
  41. {
  42. int i;
  43. int blacklisted = 0;
  44. i = acpi_match_platform_list(acpi_blacklist);
  45. if (i >= 0) {
  46. pr_err("Vendor \"%6.6s\" System \"%8.8s\" Revision 0x%x has a known ACPI BIOS problem.\n",
  47. acpi_blacklist[i].oem_id,
  48. acpi_blacklist[i].oem_table_id,
  49. acpi_blacklist[i].oem_revision);
  50. pr_err("Reason: %s. This is a %s error\n",
  51. acpi_blacklist[i].reason,
  52. (acpi_blacklist[i].data ?
  53. "non-recoverable" : "recoverable"));
  54. blacklisted = acpi_blacklist[i].data;
  55. }
  56. (void)early_acpi_osi_init();
  57. #ifdef CONFIG_DMI
  58. dmi_check_system(acpi_rev_dmi_table);
  59. #endif
  60. return blacklisted;
  61. }
  62. #ifdef CONFIG_DMI
  63. #ifdef CONFIG_ACPI_REV_OVERRIDE_POSSIBLE
  64. static int __init dmi_enable_rev_override(const struct dmi_system_id *d)
  65. {
  66. pr_notice("DMI detected: %s (force ACPI _REV to 5)\n", d->ident);
  67. acpi_rev_override_setup(NULL);
  68. return 0;
  69. }
  70. #endif
  71. static const struct dmi_system_id acpi_rev_dmi_table[] __initconst = {
  72. #ifdef CONFIG_ACPI_REV_OVERRIDE_POSSIBLE
  73. /*
  74. * DELL XPS 13 (2015) switches sound between HDA and I2S
  75. * depending on the ACPI _REV callback. If userspace supports
  76. * I2S sufficiently (or if you do not care about sound), you
  77. * can safely disable this quirk.
  78. */
  79. {
  80. .callback = dmi_enable_rev_override,
  81. .ident = "DELL XPS 13 (2015)",
  82. .matches = {
  83. DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
  84. DMI_MATCH(DMI_PRODUCT_NAME, "XPS 13 9343"),
  85. },
  86. },
  87. {
  88. .callback = dmi_enable_rev_override,
  89. .ident = "DELL Precision 5520",
  90. .matches = {
  91. DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
  92. DMI_MATCH(DMI_PRODUCT_NAME, "Precision 5520"),
  93. },
  94. },
  95. {
  96. .callback = dmi_enable_rev_override,
  97. .ident = "DELL Precision 3520",
  98. .matches = {
  99. DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
  100. DMI_MATCH(DMI_PRODUCT_NAME, "Precision 3520"),
  101. },
  102. },
  103. /*
  104. * Resolves a quirk with the Dell Latitude 3350 that
  105. * causes the ethernet adapter to not function.
  106. */
  107. {
  108. .callback = dmi_enable_rev_override,
  109. .ident = "DELL Latitude 3350",
  110. .matches = {
  111. DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
  112. DMI_MATCH(DMI_PRODUCT_NAME, "Latitude 3350"),
  113. },
  114. },
  115. {
  116. .callback = dmi_enable_rev_override,
  117. .ident = "DELL Inspiron 7537",
  118. .matches = {
  119. DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
  120. DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron 7537"),
  121. },
  122. },
  123. #endif
  124. {}
  125. };
  126. #endif /* CONFIG_DMI */