aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/osl.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/osl.c')
-rw-r--r--drivers/acpi/osl.c118
1 files changed, 108 insertions, 10 deletions
diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c
index b998340e23d4..58ceb18ec997 100644
--- a/drivers/acpi/osl.c
+++ b/drivers/acpi/osl.c
@@ -33,6 +33,7 @@
33#include <linux/interrupt.h> 33#include <linux/interrupt.h>
34#include <linux/kmod.h> 34#include <linux/kmod.h>
35#include <linux/delay.h> 35#include <linux/delay.h>
36#include <linux/dmi.h>
36#include <linux/workqueue.h> 37#include <linux/workqueue.h>
37#include <linux/nmi.h> 38#include <linux/nmi.h>
38#include <linux/acpi.h> 39#include <linux/acpi.h>
@@ -73,6 +74,21 @@ static void *acpi_irq_context;
73static struct workqueue_struct *kacpid_wq; 74static struct workqueue_struct *kacpid_wq;
74static struct workqueue_struct *kacpi_notify_wq; 75static struct workqueue_struct *kacpi_notify_wq;
75 76
77#define OSI_STRING_LENGTH_MAX 64 /* arbitrary */
78static char osi_additional_string[OSI_STRING_LENGTH_MAX];
79
80#define OSI_LINUX_ENABLED
81#ifdef OSI_LINUX_ENABLED
82int osi_linux = 1; /* enable _OSI(Linux) by default */
83#else
84int osi_linux; /* disable _OSI(Linux) by default */
85#endif
86
87
88#ifdef CONFIG_DMI
89static struct __initdata dmi_system_id acpi_osl_dmi_table[];
90#endif
91
76static void __init acpi_request_region (struct acpi_generic_address *addr, 92static void __init acpi_request_region (struct acpi_generic_address *addr,
77 unsigned int length, char *desc) 93 unsigned int length, char *desc)
78{ 94{
@@ -121,8 +137,9 @@ static int __init acpi_reserve_resources(void)
121} 137}
122device_initcall(acpi_reserve_resources); 138device_initcall(acpi_reserve_resources);
123 139
124acpi_status acpi_os_initialize(void) 140acpi_status __init acpi_os_initialize(void)
125{ 141{
142 dmi_check_system(acpi_osl_dmi_table);
126 return AE_OK; 143 return AE_OK;
127} 144}
128 145
@@ -960,20 +977,38 @@ static int __init acpi_os_name_setup(char *str)
960 977
961__setup("acpi_os_name=", acpi_os_name_setup); 978__setup("acpi_os_name=", acpi_os_name_setup);
962 979
980static void enable_osi_linux(int enable) {
981
982 if (osi_linux != enable)
983 printk(KERN_INFO PREFIX "%sabled _OSI(Linux)\n",
984 enable ? "En": "Dis");
985
986 osi_linux = enable;
987 return;
988}
989
963/* 990/*
964 * _OSI control 991 * Modify the list of "OS Interfaces" reported to BIOS via _OSI
992 *
965 * empty string disables _OSI 993 * empty string disables _OSI
966 * TBD additional string adds to _OSI 994 * string starting with '!' disables that string
995 * otherwise string is added to list, augmenting built-in strings
967 */ 996 */
968static int __init acpi_osi_setup(char *str) 997static int __init acpi_osi_setup(char *str)
969{ 998{
970 if (str == NULL || *str == '\0') { 999 if (str == NULL || *str == '\0') {
971 printk(KERN_INFO PREFIX "_OSI method disabled\n"); 1000 printk(KERN_INFO PREFIX "_OSI method disabled\n");
972 acpi_gbl_create_osi_method = FALSE; 1001 acpi_gbl_create_osi_method = FALSE;
973 } else { 1002 } else if (*str == '!') {
974 /* TBD */ 1003 if (acpi_osi_invalidate(++str) == AE_OK)
975 printk(KERN_ERR PREFIX "_OSI additional string ignored -- %s\n", 1004 printk(KERN_INFO PREFIX "Deleted _OSI(%s)\n", str);
976 str); 1005 } else if (!strcmp("!Linux", str)) {
1006 enable_osi_linux(0);
1007 } else if (!strcmp("Linux", str)) {
1008 enable_osi_linux(1);
1009 } else if (*osi_additional_string == '\0') {
1010 strncpy(osi_additional_string, str, OSI_STRING_LENGTH_MAX);
1011 printk(KERN_INFO PREFIX "Added _OSI(%s)\n", str);
977 } 1012 }
978 1013
979 return 1; 1014 return 1;
@@ -1143,11 +1178,28 @@ acpi_status acpi_os_release_object(acpi_cache_t * cache, void *object)
1143acpi_status 1178acpi_status
1144acpi_os_validate_interface (char *interface) 1179acpi_os_validate_interface (char *interface)
1145{ 1180{
1146 1181 if (!strncmp(osi_additional_string, interface, OSI_STRING_LENGTH_MAX))
1147 return AE_SUPPORT; 1182 return AE_OK;
1183 if (!strcmp("Linux", interface)) {
1184 printk(KERN_WARNING PREFIX
1185 "System BIOS is requesting _OSI(Linux)\n");
1186#ifdef OSI_LINUX_ENABLED
1187 printk(KERN_WARNING PREFIX
1188 "Please test with \"acpi_osi=!Linux\"\n"
1189 "Please send dmidecode "
1190 "to linux-acpi@vger.kernel.org\n");
1191#else
1192 printk(KERN_WARNING PREFIX
1193 "If \"acpi_osi=Linux\" works better,\n"
1194 "Please send dmidecode "
1195 "to linux-acpi@vger.kernel.org\n");
1196#endif
1197 if(osi_linux)
1198 return AE_OK;
1199 }
1200 return AE_SUPPORT;
1148} 1201}
1149 1202
1150
1151/****************************************************************************** 1203/******************************************************************************
1152 * 1204 *
1153 * FUNCTION: acpi_os_validate_address 1205 * FUNCTION: acpi_os_validate_address
@@ -1174,5 +1226,51 @@ acpi_os_validate_address (
1174 return AE_OK; 1226 return AE_OK;
1175} 1227}
1176 1228
1229#ifdef CONFIG_DMI
1230#ifdef OSI_LINUX_ENABLED
1231static int dmi_osi_not_linux(struct dmi_system_id *d)
1232{
1233 printk(KERN_NOTICE "%s detected: requires not _OSI(Linux)\n", d->ident);
1234 enable_osi_linux(0);
1235 return 0;
1236}
1237#else
1238static int dmi_osi_linux(struct dmi_system_id *d)
1239{
1240 printk(KERN_NOTICE "%s detected: requires _OSI(Linux)\n", d->ident);
1241 enable_osi_linux(1);
1242 return 0;
1243}
1244#endif
1245
1246static struct dmi_system_id acpi_osl_dmi_table[] __initdata = {
1247#ifdef OSI_LINUX_ENABLED
1248 /*
1249 * Boxes that need NOT _OSI(Linux)
1250 */
1251 {
1252 .callback = dmi_osi_not_linux,
1253 .ident = "Toshiba Satellite P100",
1254 .matches = {
1255 DMI_MATCH(DMI_BOARD_VENDOR, "TOSHIBA"),
1256 DMI_MATCH(DMI_BOARD_NAME, "Satellite P100"),
1257 },
1258 },
1259#else
1260 /*
1261 * Boxes that need _OSI(Linux)
1262 */
1263 {
1264 .callback = dmi_osi_linux,
1265 .ident = "Intel Napa CRB",
1266 .matches = {
1267 DMI_MATCH(DMI_BOARD_VENDOR, "Intel Corporation"),
1268 DMI_MATCH(DMI_BOARD_NAME, "MPAD-MSAE Customer Reference Boards"),
1269 },
1270 },
1271#endif
1272 {}
1273};
1274#endif /* CONFIG_DMI */
1177 1275
1178#endif 1276#endif