/drivers/acpi/blacklist.c

http://github.com/mirrors/linux · C · 139 lines · 97 code · 13 blank · 29 comment · 1 complexity · ecf040acf6b1c3e6c621cab92d88116f MD5 · raw file

  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 <len.brown@intel.com>
  10. * Copyright (C) 2002 Andy Grover <andrew.grover@intel.com>
  11. */
  12. #include <linux/kernel.h>
  13. #include <linux/init.h>
  14. #include <linux/acpi.h>
  15. #include <linux/dmi.h>
  16. #include "internal.h"
  17. #ifdef CONFIG_DMI
  18. static const struct dmi_system_id acpi_rev_dmi_table[] __initconst;
  19. #endif
  20. /*
  21. * POLICY: If *anything* doesn't work, put it on the blacklist.
  22. * If they are critical errors, mark it critical, and abort driver load.
  23. */
  24. static struct acpi_platform_list acpi_blacklist[] __initdata = {
  25. /* Compaq Presario 1700 */
  26. {"PTLTD ", " DSDT ", 0x06040000, ACPI_SIG_DSDT, less_than_or_equal,
  27. "Multiple problems", 1},
  28. /* Sony FX120, FX140, FX150? */
  29. {"SONY ", "U0 ", 0x20010313, ACPI_SIG_DSDT, less_than_or_equal,
  30. "ACPI driver problem", 1},
  31. /* Compaq Presario 800, Insyde BIOS */
  32. {"INT440", "SYSFexxx", 0x00001001, ACPI_SIG_DSDT, less_than_or_equal,
  33. "Does not use _REG to protect EC OpRegions", 1},
  34. /* IBM 600E - _ADR should return 7, but it returns 1 */
  35. {"IBM ", "TP600E ", 0x00000105, ACPI_SIG_DSDT, less_than_or_equal,
  36. "Incorrect _ADR", 1},
  37. { }
  38. };
  39. int __init acpi_blacklisted(void)
  40. {
  41. int i;
  42. int blacklisted = 0;
  43. i = acpi_match_platform_list(acpi_blacklist);
  44. if (i >= 0) {
  45. pr_err(PREFIX "Vendor \"%6.6s\" System \"%8.8s\" Revision 0x%x has a known ACPI BIOS problem.\n",
  46. acpi_blacklist[i].oem_id,
  47. acpi_blacklist[i].oem_table_id,
  48. acpi_blacklist[i].oem_revision);
  49. pr_err(PREFIX "Reason: %s. This is a %s error\n",
  50. acpi_blacklist[i].reason,
  51. (acpi_blacklist[i].data ?
  52. "non-recoverable" : "recoverable"));
  53. blacklisted = acpi_blacklist[i].data;
  54. }
  55. (void)early_acpi_osi_init();
  56. #ifdef CONFIG_DMI
  57. dmi_check_system(acpi_rev_dmi_table);
  58. #endif
  59. return blacklisted;
  60. }
  61. #ifdef CONFIG_DMI
  62. #ifdef CONFIG_ACPI_REV_OVERRIDE_POSSIBLE
  63. static int __init dmi_enable_rev_override(const struct dmi_system_id *d)
  64. {
  65. printk(KERN_NOTICE PREFIX "DMI detected: %s (force ACPI _REV to 5)\n",
  66. 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 */