diff options
Diffstat (limited to 'drivers/acpi/osl.c')
-rw-r--r-- | drivers/acpi/osl.c | 173 |
1 files changed, 130 insertions, 43 deletions
diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c index e3a673a00845..e53fb516f9d4 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 | ||
@@ -964,13 +1007,37 @@ static int __init acpi_os_name_setup(char *str) | |||
964 | 1007 | ||
965 | __setup("acpi_os_name=", acpi_os_name_setup); | 1008 | __setup("acpi_os_name=", acpi_os_name_setup); |
966 | 1009 | ||
967 | static void enable_osi_linux(int enable) { | 1010 | static void __init set_osi_linux(unsigned int enable) |
1011 | { | ||
1012 | if (osi_linux.enable != enable) { | ||
1013 | osi_linux.enable = enable; | ||
1014 | printk(KERN_NOTICE PREFIX "%sed _OSI(Linux)\n", | ||
1015 | enable ? "Add": "Delet"); | ||
1016 | } | ||
1017 | return; | ||
1018 | } | ||
968 | 1019 | ||
969 | if (osi_linux != enable) | 1020 | static void __init acpi_cmdline_osi_linux(unsigned int enable) |
970 | printk(KERN_INFO PREFIX "%sabled _OSI(Linux)\n", | 1021 | { |
971 | enable ? "En": "Dis"); | 1022 | osi_linux.cmdline = 1; /* cmdline set the default */ |
1023 | set_osi_linux(enable); | ||
1024 | |||
1025 | return; | ||
1026 | } | ||
1027 | |||
1028 | void __init acpi_dmi_osi_linux(int enable, const struct dmi_system_id *d) | ||
1029 | { | ||
1030 | osi_linux.dmi = 1; /* DMI knows that this box asks OSI(Linux) */ | ||
1031 | |||
1032 | printk(KERN_NOTICE PREFIX "DMI detected: %s\n", d->ident); | ||
1033 | |||
1034 | if (enable == -1) | ||
1035 | return; | ||
1036 | |||
1037 | osi_linux.known = 1; /* DMI knows which OSI(Linux) default needed */ | ||
1038 | |||
1039 | set_osi_linux(enable); | ||
972 | 1040 | ||
973 | osi_linux = enable; | ||
974 | return; | 1041 | return; |
975 | } | 1042 | } |
976 | 1043 | ||
@@ -987,12 +1054,12 @@ static int __init acpi_osi_setup(char *str) | |||
987 | printk(KERN_INFO PREFIX "_OSI method disabled\n"); | 1054 | printk(KERN_INFO PREFIX "_OSI method disabled\n"); |
988 | acpi_gbl_create_osi_method = FALSE; | 1055 | acpi_gbl_create_osi_method = FALSE; |
989 | } else if (!strcmp("!Linux", str)) { | 1056 | } else if (!strcmp("!Linux", str)) { |
990 | enable_osi_linux(0); | 1057 | acpi_cmdline_osi_linux(0); /* !enable */ |
991 | } else if (*str == '!') { | 1058 | } else if (*str == '!') { |
992 | if (acpi_osi_invalidate(++str) == AE_OK) | 1059 | if (acpi_osi_invalidate(++str) == AE_OK) |
993 | printk(KERN_INFO PREFIX "Deleted _OSI(%s)\n", str); | 1060 | printk(KERN_INFO PREFIX "Deleted _OSI(%s)\n", str); |
994 | } else if (!strcmp("Linux", str)) { | 1061 | } else if (!strcmp("Linux", str)) { |
995 | enable_osi_linux(1); | 1062 | acpi_cmdline_osi_linux(1); /* enable */ |
996 | } else if (*osi_additional_string == '\0') { | 1063 | } else if (*osi_additional_string == '\0') { |
997 | strncpy(osi_additional_string, str, OSI_STRING_LENGTH_MAX); | 1064 | strncpy(osi_additional_string, str, OSI_STRING_LENGTH_MAX); |
998 | printk(KERN_INFO PREFIX "Added _OSI(%s)\n", str); | 1065 | printk(KERN_INFO PREFIX "Added _OSI(%s)\n", str); |
@@ -1141,6 +1208,34 @@ acpi_status acpi_os_release_object(acpi_cache_t * cache, void *object) | |||
1141 | return (AE_OK); | 1208 | return (AE_OK); |
1142 | } | 1209 | } |
1143 | 1210 | ||
1211 | /** | ||
1212 | * acpi_dmi_dump - dump DMI slots needed for blacklist entry | ||
1213 | * | ||
1214 | * Returns 0 on success | ||
1215 | */ | ||
1216 | int acpi_dmi_dump(void) | ||
1217 | { | ||
1218 | |||
1219 | if (!dmi_available) | ||
1220 | return -1; | ||
1221 | |||
1222 | printk(KERN_NOTICE PREFIX "DMI System Vendor: %s\n", | ||
1223 | dmi_get_slot(DMI_SYS_VENDOR)); | ||
1224 | printk(KERN_NOTICE PREFIX "DMI Product Name: %s\n", | ||
1225 | dmi_get_slot(DMI_PRODUCT_NAME)); | ||
1226 | printk(KERN_NOTICE PREFIX "DMI Product Version: %s\n", | ||
1227 | dmi_get_slot(DMI_PRODUCT_VERSION)); | ||
1228 | printk(KERN_NOTICE PREFIX "DMI Board Name: %s\n", | ||
1229 | dmi_get_slot(DMI_BOARD_NAME)); | ||
1230 | printk(KERN_NOTICE PREFIX "DMI BIOS Vendor: %s\n", | ||
1231 | dmi_get_slot(DMI_BIOS_VENDOR)); | ||
1232 | printk(KERN_NOTICE PREFIX "DMI BIOS Date: %s\n", | ||
1233 | dmi_get_slot(DMI_BIOS_DATE)); | ||
1234 | |||
1235 | return 0; | ||
1236 | } | ||
1237 | |||
1238 | |||
1144 | /****************************************************************************** | 1239 | /****************************************************************************** |
1145 | * | 1240 | * |
1146 | * FUNCTION: acpi_os_validate_interface | 1241 | * FUNCTION: acpi_os_validate_interface |
@@ -1160,13 +1255,29 @@ acpi_os_validate_interface (char *interface) | |||
1160 | if (!strncmp(osi_additional_string, interface, OSI_STRING_LENGTH_MAX)) | 1255 | if (!strncmp(osi_additional_string, interface, OSI_STRING_LENGTH_MAX)) |
1161 | return AE_OK; | 1256 | return AE_OK; |
1162 | if (!strcmp("Linux", interface)) { | 1257 | if (!strcmp("Linux", interface)) { |
1163 | printk(KERN_WARNING PREFIX | 1258 | |
1164 | "System BIOS is requesting _OSI(Linux)\n"); | 1259 | printk(KERN_NOTICE PREFIX |
1165 | printk(KERN_WARNING PREFIX | 1260 | "BIOS _OSI(Linux) query %s%s\n", |
1166 | "If \"acpi_osi=Linux\" works better,\n" | 1261 | osi_linux.enable ? "honored" : "ignored", |
1167 | "Please send dmidecode " | 1262 | osi_linux.cmdline ? " via cmdline" : |
1168 | "to linux-acpi@vger.kernel.org\n"); | 1263 | osi_linux.dmi ? " via DMI" : ""); |
1169 | if(osi_linux) | 1264 | |
1265 | if (!osi_linux.dmi) { | ||
1266 | if (acpi_dmi_dump()) | ||
1267 | printk(KERN_NOTICE PREFIX | ||
1268 | "[please extract dmidecode output]\n"); | ||
1269 | printk(KERN_NOTICE PREFIX | ||
1270 | "Please send DMI info above to " | ||
1271 | "linux-acpi@vger.kernel.org\n"); | ||
1272 | } | ||
1273 | if (!osi_linux.known && !osi_linux.cmdline) { | ||
1274 | printk(KERN_NOTICE PREFIX | ||
1275 | "If \"acpi_osi=%sLinux\" works better, " | ||
1276 | "please notify linux-acpi@vger.kernel.org\n", | ||
1277 | osi_linux.enable ? "!" : ""); | ||
1278 | } | ||
1279 | |||
1280 | if (osi_linux.enable) | ||
1170 | return AE_OK; | 1281 | return AE_OK; |
1171 | } | 1282 | } |
1172 | return AE_SUPPORT; | 1283 | return AE_SUPPORT; |
@@ -1198,28 +1309,4 @@ acpi_os_validate_address ( | |||
1198 | return AE_OK; | 1309 | return AE_OK; |
1199 | } | 1310 | } |
1200 | 1311 | ||
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 | 1312 | #endif |