diff options
Diffstat (limited to 'drivers/acpi/osl.c')
-rw-r--r-- | drivers/acpi/osl.c | 181 |
1 files changed, 136 insertions, 45 deletions
diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c index e3a673a00845..e96f3d933f67 100644 --- a/drivers/acpi/osl.c +++ b/drivers/acpi/osl.c | |||
@@ -77,11 +77,55 @@ static struct workqueue_struct *kacpi_notify_wq; | |||
77 | #define OSI_STRING_LENGTH_MAX 64 /* arbitrary */ | 77 | #define OSI_STRING_LENGTH_MAX 64 /* arbitrary */ |
78 | static char osi_additional_string[OSI_STRING_LENGTH_MAX]; | 78 | static char osi_additional_string[OSI_STRING_LENGTH_MAX]; |
79 | 79 | ||
80 | static int osi_linux; /* disable _OSI(Linux) by default */ | 80 | /* |
81 | * "Ode to _OSI(Linux)" | ||
82 | * | ||
83 | * osi_linux -- Control response to BIOS _OSI(Linux) query. | ||
84 | * | ||
85 | * As Linux evolves, the features that it supports change. | ||
86 | * So an OSI string such as "Linux" is not specific enough | ||
87 | * to be useful across multiple versions of Linux. It | ||
88 | * doesn't identify any particular feature, interface, | ||
89 | * or even any particular version of Linux... | ||
90 | * | ||
91 | * Unfortunately, Linux-2.6.22 and earlier responded "yes" | ||
92 | * to a BIOS _OSI(Linux) query. When | ||
93 | * a reference mobile BIOS started using it, its use | ||
94 | * started to spread to many vendor platforms. | ||
95 | * As it is not supportable, we need to halt that spread. | ||
96 | * | ||
97 | * Today, most BIOS references to _OSI(Linux) are noise -- | ||
98 | * they have no functional effect and are just dead code | ||
99 | * carried over from the reference BIOS. | ||
100 | * | ||
101 | * The next most common case is that _OSI(Linux) harms Linux, | ||
102 | * usually by causing the BIOS to follow paths that are | ||
103 | * not tested during Windows validation. | ||
104 | * | ||
105 | * Finally, there is a short list of platforms | ||
106 | * where OSI(Linux) benefits Linux. | ||
107 | * | ||
108 | * In Linux-2.6.23, OSI(Linux) is first disabled by default. | ||
109 | * DMI is used to disable the dmesg warning about OSI(Linux) | ||
110 | * on platforms where it is known to have no effect. | ||
111 | * But a dmesg warning remains for systems where | ||
112 | * we do not know if OSI(Linux) is good or bad for the system. | ||
113 | * DMI is also used to enable OSI(Linux) for the machines | ||
114 | * that are known to need it. | ||
115 | * | ||
116 | * BIOS writers should NOT query _OSI(Linux) on future systems. | ||
117 | * It will be ignored by default, and to get Linux to | ||
118 | * not ignore it will require a kernel source update to | ||
119 | * add a DMI entry, or a boot-time "acpi_osi=Linux" invocation. | ||
120 | */ | ||
121 | #define OSI_LINUX_ENABLE 0 | ||
81 | 122 | ||
82 | #ifdef CONFIG_DMI | 123 | struct osi_linux { |
83 | static struct __initdata dmi_system_id acpi_osl_dmi_table[]; | 124 | unsigned int enable:1; |
84 | #endif | 125 | unsigned int dmi:1; |
126 | unsigned int cmdline:1; | ||
127 | unsigned int known:1; | ||
128 | } osi_linux = { OSI_LINUX_ENABLE, 0, 0, 0}; | ||
85 | 129 | ||
86 | static void __init acpi_request_region (struct acpi_generic_address *addr, | 130 | static void __init acpi_request_region (struct acpi_generic_address *addr, |
87 | unsigned int length, char *desc) | 131 | unsigned int length, char *desc) |
@@ -133,7 +177,6 @@ device_initcall(acpi_reserve_resources); | |||
133 | 177 | ||
134 | acpi_status __init acpi_os_initialize(void) | 178 | acpi_status __init acpi_os_initialize(void) |
135 | { | 179 | { |
136 | dmi_check_system(acpi_osl_dmi_table); | ||
137 | return AE_OK; | 180 | return AE_OK; |
138 | } | 181 | } |
139 | 182 | ||
@@ -207,8 +250,12 @@ acpi_physical_address __init acpi_os_get_root_pointer(void) | |||
207 | "System description tables not found\n"); | 250 | "System description tables not found\n"); |
208 | return 0; | 251 | return 0; |
209 | } | 252 | } |
210 | } else | 253 | } else { |
211 | return acpi_find_rsdp(); | 254 | acpi_physical_address pa = 0; |
255 | |||
256 | acpi_find_root_pointer(&pa); | ||
257 | return pa; | ||
258 | } | ||
212 | } | 259 | } |
213 | 260 | ||
214 | void __iomem *acpi_os_map_memory(acpi_physical_address phys, acpi_size size) | 261 | void __iomem *acpi_os_map_memory(acpi_physical_address phys, acpi_size size) |
@@ -964,13 +1011,37 @@ static int __init acpi_os_name_setup(char *str) | |||
964 | 1011 | ||
965 | __setup("acpi_os_name=", acpi_os_name_setup); | 1012 | __setup("acpi_os_name=", acpi_os_name_setup); |
966 | 1013 | ||
967 | static void enable_osi_linux(int enable) { | 1014 | static void __init set_osi_linux(unsigned int enable) |
1015 | { | ||
1016 | if (osi_linux.enable != enable) { | ||
1017 | osi_linux.enable = enable; | ||
1018 | printk(KERN_NOTICE PREFIX "%sed _OSI(Linux)\n", | ||
1019 | enable ? "Add": "Delet"); | ||
1020 | } | ||
1021 | return; | ||
1022 | } | ||
1023 | |||
1024 | static void __init acpi_cmdline_osi_linux(unsigned int enable) | ||
1025 | { | ||
1026 | osi_linux.cmdline = 1; /* cmdline set the default */ | ||
1027 | set_osi_linux(enable); | ||
1028 | |||
1029 | return; | ||
1030 | } | ||
1031 | |||
1032 | void __init acpi_dmi_osi_linux(int enable, const struct dmi_system_id *d) | ||
1033 | { | ||
1034 | osi_linux.dmi = 1; /* DMI knows that this box asks OSI(Linux) */ | ||
1035 | |||
1036 | printk(KERN_NOTICE PREFIX "DMI detected: %s\n", d->ident); | ||
1037 | |||
1038 | if (enable == -1) | ||
1039 | return; | ||
1040 | |||
1041 | osi_linux.known = 1; /* DMI knows which OSI(Linux) default needed */ | ||
968 | 1042 | ||
969 | if (osi_linux != enable) | 1043 | set_osi_linux(enable); |
970 | printk(KERN_INFO PREFIX "%sabled _OSI(Linux)\n", | ||
971 | enable ? "En": "Dis"); | ||
972 | 1044 | ||
973 | osi_linux = enable; | ||
974 | return; | 1045 | return; |
975 | } | 1046 | } |
976 | 1047 | ||
@@ -987,12 +1058,12 @@ static int __init acpi_osi_setup(char *str) | |||
987 | printk(KERN_INFO PREFIX "_OSI method disabled\n"); | 1058 | printk(KERN_INFO PREFIX "_OSI method disabled\n"); |
988 | acpi_gbl_create_osi_method = FALSE; | 1059 | acpi_gbl_create_osi_method = FALSE; |
989 | } else if (!strcmp("!Linux", str)) { | 1060 | } else if (!strcmp("!Linux", str)) { |
990 | enable_osi_linux(0); | 1061 | acpi_cmdline_osi_linux(0); /* !enable */ |
991 | } else if (*str == '!') { | 1062 | } else if (*str == '!') { |
992 | if (acpi_osi_invalidate(++str) == AE_OK) | 1063 | if (acpi_osi_invalidate(++str) == AE_OK) |
993 | printk(KERN_INFO PREFIX "Deleted _OSI(%s)\n", str); | 1064 | printk(KERN_INFO PREFIX "Deleted _OSI(%s)\n", str); |
994 | } else if (!strcmp("Linux", str)) { | 1065 | } else if (!strcmp("Linux", str)) { |
995 | enable_osi_linux(1); | 1066 | acpi_cmdline_osi_linux(1); /* enable */ |
996 | } else if (*osi_additional_string == '\0') { | 1067 | } else if (*osi_additional_string == '\0') { |
997 | strncpy(osi_additional_string, str, OSI_STRING_LENGTH_MAX); | 1068 | strncpy(osi_additional_string, str, OSI_STRING_LENGTH_MAX); |
998 | printk(KERN_INFO PREFIX "Added _OSI(%s)\n", str); | 1069 | printk(KERN_INFO PREFIX "Added _OSI(%s)\n", str); |
@@ -1141,6 +1212,34 @@ acpi_status acpi_os_release_object(acpi_cache_t * cache, void *object) | |||
1141 | return (AE_OK); | 1212 | return (AE_OK); |
1142 | } | 1213 | } |
1143 | 1214 | ||
1215 | /** | ||
1216 | * acpi_dmi_dump - dump DMI slots needed for blacklist entry | ||
1217 | * | ||
1218 | * Returns 0 on success | ||
1219 | */ | ||
1220 | int acpi_dmi_dump(void) | ||
1221 | { | ||
1222 | |||
1223 | if (!dmi_available) | ||
1224 | return -1; | ||
1225 | |||
1226 | printk(KERN_NOTICE PREFIX "DMI System Vendor: %s\n", | ||
1227 | dmi_get_slot(DMI_SYS_VENDOR)); | ||
1228 | printk(KERN_NOTICE PREFIX "DMI Product Name: %s\n", | ||
1229 | dmi_get_slot(DMI_PRODUCT_NAME)); | ||
1230 | printk(KERN_NOTICE PREFIX "DMI Product Version: %s\n", | ||
1231 | dmi_get_slot(DMI_PRODUCT_VERSION)); | ||
1232 | printk(KERN_NOTICE PREFIX "DMI Board Name: %s\n", | ||
1233 | dmi_get_slot(DMI_BOARD_NAME)); | ||
1234 | printk(KERN_NOTICE PREFIX "DMI BIOS Vendor: %s\n", | ||
1235 | dmi_get_slot(DMI_BIOS_VENDOR)); | ||
1236 | printk(KERN_NOTICE PREFIX "DMI BIOS Date: %s\n", | ||
1237 | dmi_get_slot(DMI_BIOS_DATE)); | ||
1238 | |||
1239 | return 0; | ||
1240 | } | ||
1241 | |||
1242 | |||
1144 | /****************************************************************************** | 1243 | /****************************************************************************** |
1145 | * | 1244 | * |
1146 | * FUNCTION: acpi_os_validate_interface | 1245 | * FUNCTION: acpi_os_validate_interface |
@@ -1160,13 +1259,29 @@ acpi_os_validate_interface (char *interface) | |||
1160 | if (!strncmp(osi_additional_string, interface, OSI_STRING_LENGTH_MAX)) | 1259 | if (!strncmp(osi_additional_string, interface, OSI_STRING_LENGTH_MAX)) |
1161 | return AE_OK; | 1260 | return AE_OK; |
1162 | if (!strcmp("Linux", interface)) { | 1261 | if (!strcmp("Linux", interface)) { |
1163 | printk(KERN_WARNING PREFIX | 1262 | |
1164 | "System BIOS is requesting _OSI(Linux)\n"); | 1263 | printk(KERN_NOTICE PREFIX |
1165 | printk(KERN_WARNING PREFIX | 1264 | "BIOS _OSI(Linux) query %s%s\n", |
1166 | "If \"acpi_osi=Linux\" works better,\n" | 1265 | osi_linux.enable ? "honored" : "ignored", |
1167 | "Please send dmidecode " | 1266 | osi_linux.cmdline ? " via cmdline" : |
1168 | "to linux-acpi@vger.kernel.org\n"); | 1267 | osi_linux.dmi ? " via DMI" : ""); |
1169 | if(osi_linux) | 1268 | |
1269 | if (!osi_linux.dmi) { | ||
1270 | if (acpi_dmi_dump()) | ||
1271 | printk(KERN_NOTICE PREFIX | ||
1272 | "[please extract dmidecode output]\n"); | ||
1273 | printk(KERN_NOTICE PREFIX | ||
1274 | "Please send DMI info above to " | ||
1275 | "linux-acpi@vger.kernel.org\n"); | ||
1276 | } | ||
1277 | if (!osi_linux.known && !osi_linux.cmdline) { | ||
1278 | printk(KERN_NOTICE PREFIX | ||
1279 | "If \"acpi_osi=%sLinux\" works better, " | ||
1280 | "please notify linux-acpi@vger.kernel.org\n", | ||
1281 | osi_linux.enable ? "!" : ""); | ||
1282 | } | ||
1283 | |||
1284 | if (osi_linux.enable) | ||
1170 | return AE_OK; | 1285 | return AE_OK; |
1171 | } | 1286 | } |
1172 | return AE_SUPPORT; | 1287 | return AE_SUPPORT; |
@@ -1198,28 +1313,4 @@ acpi_os_validate_address ( | |||
1198 | return AE_OK; | 1313 | return AE_OK; |
1199 | } | 1314 | } |
1200 | 1315 | ||
1201 | #ifdef CONFIG_DMI | ||
1202 | static int dmi_osi_linux(const struct dmi_system_id *d) | ||
1203 | { | ||
1204 | printk(KERN_NOTICE "%s detected: enabling _OSI(Linux)\n", d->ident); | ||
1205 | enable_osi_linux(1); | ||
1206 | return 0; | ||
1207 | } | ||
1208 | |||
1209 | static struct dmi_system_id acpi_osl_dmi_table[] __initdata = { | ||
1210 | /* | ||
1211 | * Boxes that need _OSI(Linux) | ||
1212 | */ | ||
1213 | { | ||
1214 | .callback = dmi_osi_linux, | ||
1215 | .ident = "Intel Napa CRB", | ||
1216 | .matches = { | ||
1217 | DMI_MATCH(DMI_BOARD_VENDOR, "Intel Corporation"), | ||
1218 | DMI_MATCH(DMI_BOARD_NAME, "MPAD-MSAE Customer Reference Boards"), | ||
1219 | }, | ||
1220 | }, | ||
1221 | {} | ||
1222 | }; | ||
1223 | #endif /* CONFIG_DMI */ | ||
1224 | |||
1225 | #endif | 1316 | #endif |