blacklist.c 4.3 KB

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