Blame view
drivers/acpi/blacklist.c
4.6 KB
1da177e4c Linux-2.6.12-rc2 |
1 2 3 4 5 |
/* * blacklist.c * * Check to see if the given machine has a known bad ACPI BIOS * or if the BIOS is too old. |
e5f660ebe ACPI / osi: Colle... |
6 |
* Check given machine against acpi_rev_dmi_table[]. |
1da177e4c Linux-2.6.12-rc2 |
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
* * Copyright (C) 2004 Len Brown <len.brown@intel.com> * Copyright (C) 2002 Andy Grover <andrew.grover@intel.com> * * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or (at * your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * |
1da177e4c Linux-2.6.12-rc2 |
23 24 |
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ |
1da177e4c Linux-2.6.12-rc2 |
25 |
#include <linux/kernel.h> |
1da177e4c Linux-2.6.12-rc2 |
26 27 |
#include <linux/init.h> #include <linux/acpi.h> |
1da177e4c Linux-2.6.12-rc2 |
28 |
#include <linux/dmi.h> |
a192a9580 ACPI: Move defini... |
29 |
#include "internal.h" |
4be44fcd3 [ACPI] Lindent al... |
30 31 32 33 34 |
enum acpi_blacklist_predicates { all_versions, less_than_or_equal, equal, greater_than_or_equal, |
1da177e4c Linux-2.6.12-rc2 |
35 |
}; |
4be44fcd3 [ACPI] Lindent al... |
36 37 38 39 |
struct acpi_blacklist_item { char oem_id[7]; char oem_table_id[9]; u32 oem_revision; |
ad71860a1 ACPICA: minimal p... |
40 |
char *table; |
4be44fcd3 [ACPI] Lindent al... |
41 42 43 |
enum acpi_blacklist_predicates oem_revision_predicate; char *reason; u32 is_critical_error; |
1da177e4c Linux-2.6.12-rc2 |
44 |
}; |
e5f660ebe ACPI / osi: Colle... |
45 |
static struct dmi_system_id acpi_rev_dmi_table[] __initdata; |
d4b7dc499 ACPI: make _OSI(L... |
46 |
|
1da177e4c Linux-2.6.12-rc2 |
47 48 49 50 |
/* * POLICY: If *anything* doesn't work, put it on the blacklist. * If they are critical errors, mark it critical, and abort driver load. */ |
4be44fcd3 [ACPI] Lindent al... |
51 |
static struct acpi_blacklist_item acpi_blacklist[] __initdata = { |
1da177e4c Linux-2.6.12-rc2 |
52 |
/* Compaq Presario 1700 */ |
ad71860a1 ACPICA: minimal p... |
53 |
{"PTLTD ", " DSDT ", 0x06040000, ACPI_SIG_DSDT, less_than_or_equal, |
4be44fcd3 [ACPI] Lindent al... |
54 |
"Multiple problems", 1}, |
1da177e4c Linux-2.6.12-rc2 |
55 |
/* Sony FX120, FX140, FX150? */ |
ad71860a1 ACPICA: minimal p... |
56 |
{"SONY ", "U0 ", 0x20010313, ACPI_SIG_DSDT, less_than_or_equal, |
4be44fcd3 [ACPI] Lindent al... |
57 |
"ACPI driver problem", 1}, |
1da177e4c Linux-2.6.12-rc2 |
58 |
/* Compaq Presario 800, Insyde BIOS */ |
ad71860a1 ACPICA: minimal p... |
59 |
{"INT440", "SYSFexxx", 0x00001001, ACPI_SIG_DSDT, less_than_or_equal, |
4be44fcd3 [ACPI] Lindent al... |
60 |
"Does not use _REG to protect EC OpRegions", 1}, |
1da177e4c Linux-2.6.12-rc2 |
61 |
/* IBM 600E - _ADR should return 7, but it returns 1 */ |
ad71860a1 ACPICA: minimal p... |
62 |
{"IBM ", "TP600E ", 0x00000105, ACPI_SIG_DSDT, less_than_or_equal, |
4be44fcd3 [ACPI] Lindent al... |
63 |
"Incorrect _ADR", 1}, |
1da177e4c Linux-2.6.12-rc2 |
64 65 66 |
{""} }; |
4be44fcd3 [ACPI] Lindent al... |
67 |
int __init acpi_blacklisted(void) |
1da177e4c Linux-2.6.12-rc2 |
68 69 70 |
{ int i = 0; int blacklisted = 0; |
428f21129 ACPICA: Miscellan... |
71 |
struct acpi_table_header table_header; |
1da177e4c Linux-2.6.12-rc2 |
72 |
|
4be44fcd3 [ACPI] Lindent al... |
73 |
while (acpi_blacklist[i].oem_id[0] != '\0') { |
ad71860a1 ACPICA: minimal p... |
74 |
if (acpi_get_table_header(acpi_blacklist[i].table, 0, &table_header)) { |
1da177e4c Linux-2.6.12-rc2 |
75 76 77 |
i++; continue; } |
428f21129 ACPICA: Miscellan... |
78 |
if (strncmp(acpi_blacklist[i].oem_id, table_header.oem_id, 6)) { |
1da177e4c Linux-2.6.12-rc2 |
79 80 81 |
i++; continue; } |
4be44fcd3 [ACPI] Lindent al... |
82 |
if (strncmp |
428f21129 ACPICA: Miscellan... |
83 |
(acpi_blacklist[i].oem_table_id, table_header.oem_table_id, |
4be44fcd3 [ACPI] Lindent al... |
84 |
8)) { |
1da177e4c Linux-2.6.12-rc2 |
85 86 87 88 89 |
i++; continue; } if ((acpi_blacklist[i].oem_revision_predicate == all_versions) |
4be44fcd3 [ACPI] Lindent al... |
90 91 |
|| (acpi_blacklist[i].oem_revision_predicate == less_than_or_equal |
428f21129 ACPICA: Miscellan... |
92 |
&& table_header.oem_revision <= |
4be44fcd3 [ACPI] Lindent al... |
93 94 95 |
acpi_blacklist[i].oem_revision) || (acpi_blacklist[i].oem_revision_predicate == greater_than_or_equal |
428f21129 ACPICA: Miscellan... |
96 |
&& table_header.oem_revision >= |
4be44fcd3 [ACPI] Lindent al... |
97 |
acpi_blacklist[i].oem_revision) |
1da177e4c Linux-2.6.12-rc2 |
98 |
|| (acpi_blacklist[i].oem_revision_predicate == equal |
428f21129 ACPICA: Miscellan... |
99 |
&& table_header.oem_revision == |
4be44fcd3 [ACPI] Lindent al... |
100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 |
acpi_blacklist[i].oem_revision)) { printk(KERN_ERR PREFIX "Vendor \"%6.6s\" System \"%8.8s\" " "Revision 0x%x has a known ACPI BIOS problem. ", acpi_blacklist[i].oem_id, acpi_blacklist[i].oem_table_id, acpi_blacklist[i].oem_revision); printk(KERN_ERR PREFIX "Reason: %s. This is a %s error ", acpi_blacklist[i].reason, (acpi_blacklist[i]. is_critical_error ? "non-recoverable" : "recoverable")); |
1da177e4c Linux-2.6.12-rc2 |
117 118 119 |
blacklisted = acpi_blacklist[i].is_critical_error; break; |
4be44fcd3 [ACPI] Lindent al... |
120 |
} else { |
1da177e4c Linux-2.6.12-rc2 |
121 122 123 |
i++; } } |
e5f660ebe ACPI / osi: Colle... |
124 125 |
(void)early_acpi_osi_init(); dmi_check_system(acpi_rev_dmi_table); |
d4b7dc499 ACPI: make _OSI(L... |
126 |
|
1da177e4c Linux-2.6.12-rc2 |
127 128 |
return blacklisted; } |
d4b7dc499 ACPI: make _OSI(L... |
129 |
#ifdef CONFIG_DMI |
18d78b64f ACPI / init: Make... |
130 131 132 133 134 135 136 137 138 139 |
#ifdef CONFIG_ACPI_REV_OVERRIDE_POSSIBLE static int __init dmi_enable_rev_override(const struct dmi_system_id *d) { printk(KERN_NOTICE PREFIX "DMI detected: %s (force ACPI _REV to 5) ", d->ident); acpi_rev_override_setup(NULL); return 0; } #endif |
a1bd4e35e ACPI: DMI blackli... |
140 |
|
e5f660ebe ACPI / osi: Colle... |
141 |
static struct dmi_system_id acpi_rev_dmi_table[] __initdata = { |
18d78b64f ACPI / init: Make... |
142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 |
#ifdef CONFIG_ACPI_REV_OVERRIDE_POSSIBLE /* * DELL XPS 13 (2015) switches sound between HDA and I2S * depending on the ACPI _REV callback. If userspace supports * I2S sufficiently (or if you do not care about sound), you * can safely disable this quirk. */ { .callback = dmi_enable_rev_override, .ident = "DELL XPS 13 (2015)", .matches = { DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), DMI_MATCH(DMI_PRODUCT_NAME, "XPS 13 9343"), }, }, #endif |
d4b7dc499 ACPI: make _OSI(L... |
158 159 160 161 |
{} }; #endif /* CONFIG_DMI */ |