blacklist.c 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  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. static const struct dmi_system_id acpi_rev_dmi_table[] __initconst;
  31. /*
  32. * POLICY: If *anything* doesn't work, put it on the blacklist.
  33. * If they are critical errors, mark it critical, and abort driver load.
  34. */
  35. static struct acpi_platform_list acpi_blacklist[] __initdata = {
  36. /* Compaq Presario 1700 */
  37. {"PTLTD ", " DSDT ", 0x06040000, ACPI_SIG_DSDT, less_than_or_equal,
  38. "Multiple problems", 1},
  39. /* Sony FX120, FX140, FX150? */
  40. {"SONY ", "U0 ", 0x20010313, ACPI_SIG_DSDT, less_than_or_equal,
  41. "ACPI driver problem", 1},
  42. /* Compaq Presario 800, Insyde BIOS */
  43. {"INT440", "SYSFexxx", 0x00001001, ACPI_SIG_DSDT, less_than_or_equal,
  44. "Does not use _REG to protect EC OpRegions", 1},
  45. /* IBM 600E - _ADR should return 7, but it returns 1 */
  46. {"IBM ", "TP600E ", 0x00000105, ACPI_SIG_DSDT, less_than_or_equal,
  47. "Incorrect _ADR", 1},
  48. { }
  49. };
  50. int __init acpi_blacklisted(void)
  51. {
  52. int i;
  53. int blacklisted = 0;
  54. i = acpi_match_platform_list(acpi_blacklist);
  55. if (i >= 0) {
  56. pr_err(PREFIX "Vendor \"%6.6s\" System \"%8.8s\" Revision 0x%x has a known ACPI BIOS problem.\n",
  57. acpi_blacklist[i].oem_id,
  58. acpi_blacklist[i].oem_table_id,
  59. acpi_blacklist[i].oem_revision);
  60. pr_err(PREFIX "Reason: %s. This is a %s error\n",
  61. acpi_blacklist[i].reason,
  62. (acpi_blacklist[i].data ?
  63. "non-recoverable" : "recoverable"));
  64. blacklisted = acpi_blacklist[i].data;
  65. }
  66. (void)early_acpi_osi_init();
  67. dmi_check_system(acpi_rev_dmi_table);
  68. return blacklisted;
  69. }
  70. #ifdef CONFIG_DMI
  71. #ifdef CONFIG_ACPI_REV_OVERRIDE_POSSIBLE
  72. static int __init dmi_enable_rev_override(const struct dmi_system_id *d)
  73. {
  74. printk(KERN_NOTICE PREFIX "DMI detected: %s (force ACPI _REV to 5)\n",
  75. d->ident);
  76. acpi_rev_override_setup(NULL);
  77. return 0;
  78. }
  79. #endif
  80. static const struct dmi_system_id acpi_rev_dmi_table[] __initconst = {
  81. #ifdef CONFIG_ACPI_REV_OVERRIDE_POSSIBLE
  82. /*
  83. * DELL XPS 13 (2015) switches sound between HDA and I2S
  84. * depending on the ACPI _REV callback. If userspace supports
  85. * I2S sufficiently (or if you do not care about sound), you
  86. * can safely disable this quirk.
  87. */
  88. {
  89. .callback = dmi_enable_rev_override,
  90. .ident = "DELL XPS 13 (2015)",
  91. .matches = {
  92. DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
  93. DMI_MATCH(DMI_PRODUCT_NAME, "XPS 13 9343"),
  94. },
  95. },
  96. {
  97. .callback = dmi_enable_rev_override,
  98. .ident = "DELL Precision 5520",
  99. .matches = {
  100. DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
  101. DMI_MATCH(DMI_PRODUCT_NAME, "Precision 5520"),
  102. },
  103. },
  104. {
  105. .callback = dmi_enable_rev_override,
  106. .ident = "DELL Precision 3520",
  107. .matches = {
  108. DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
  109. DMI_MATCH(DMI_PRODUCT_NAME, "Precision 3520"),
  110. },
  111. },
  112. /*
  113. * Resolves a quirk with the Dell Latitude 3350 that
  114. * causes the ethernet adapter to not function.
  115. */
  116. {
  117. .callback = dmi_enable_rev_override,
  118. .ident = "DELL Latitude 3350",
  119. .matches = {
  120. DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
  121. DMI_MATCH(DMI_PRODUCT_NAME, "Latitude 3350"),
  122. },
  123. },
  124. {
  125. .callback = dmi_enable_rev_override,
  126. .ident = "DELL Inspiron 7537",
  127. .matches = {
  128. DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
  129. DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron 7537"),
  130. },
  131. },
  132. #endif
  133. {}
  134. };
  135. #endif /* CONFIG_DMI */