aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi')
-rw-r--r--drivers/acpi/Kconfig22
-rw-r--r--drivers/acpi/Makefile8
-rw-r--r--drivers/acpi/ac.c3
-rw-r--r--drivers/acpi/acpi_memhotplug.c1
-rw-r--r--drivers/acpi/battery.c3
-rw-r--r--drivers/acpi/blacklist.c401
-rw-r--r--drivers/acpi/bus.c11
-rw-r--r--drivers/acpi/button.c3
-rw-r--r--drivers/acpi/cm_sbs.c7
-rw-r--r--drivers/acpi/container.c1
-rw-r--r--drivers/acpi/debug.c15
-rw-r--r--drivers/acpi/ec.c98
-rw-r--r--drivers/acpi/events/evgpe.c2
-rw-r--r--drivers/acpi/events/evxfevnt.c41
-rw-r--r--drivers/acpi/fan.c1
-rw-r--r--drivers/acpi/glue.c40
-rw-r--r--drivers/acpi/osl.c104
-rw-r--r--drivers/acpi/pci_irq.c56
-rw-r--r--drivers/acpi/pci_link.c11
-rw-r--r--drivers/acpi/pci_root.c6
-rw-r--r--drivers/acpi/power.c11
-rw-r--r--drivers/acpi/processor_core.c93
-rw-r--r--drivers/acpi/processor_idle.c1
-rw-r--r--drivers/acpi/processor_perflib.c2
-rw-r--r--drivers/acpi/processor_thermal.c1
-rw-r--r--drivers/acpi/processor_throttling.c2
-rw-r--r--drivers/acpi/reboot.c25
-rw-r--r--drivers/acpi/scan.c52
-rw-r--r--drivers/acpi/sleep/main.c40
-rw-r--r--drivers/acpi/sleep/proc.c2
-rw-r--r--drivers/acpi/sleep/wakeup.c8
-rw-r--r--drivers/acpi/system.c48
-rw-r--r--drivers/acpi/tables/tbfadt.c2
-rw-r--r--drivers/acpi/thermal.c9
-rw-r--r--drivers/acpi/toshiba_acpi.c56
-rw-r--r--drivers/acpi/utils.c16
-rw-r--r--drivers/acpi/video.c42
-rw-r--r--drivers/acpi/video_detect.c267
-rw-r--r--drivers/acpi/wmi.c2
39 files changed, 720 insertions, 793 deletions
diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig
index f4f632917509..b0243fd55ac0 100644
--- a/drivers/acpi/Kconfig
+++ b/drivers/acpi/Kconfig
@@ -312,9 +312,13 @@ config ACPI_DEBUG
312 bool "Debug Statements" 312 bool "Debug Statements"
313 default n 313 default n
314 help 314 help
315 The ACPI driver can optionally report errors with a great deal 315 The ACPI subsystem can produce debug output. Saying Y enables this
316 of verbosity. Saying Y enables these statements. This will increase 316 output and increases the kernel size by around 50K.
317 your kernel size by around 50K. 317
318 Use the acpi.debug_layer and acpi.debug_level kernel command-line
319 parameters documented in Documentation/acpi/debug.txt and
320 Documentation/kernel-parameters.txt to control the type and
321 amount of debug output.
318 322
319config ACPI_DEBUG_FUNC_TRACE 323config ACPI_DEBUG_FUNC_TRACE
320 bool "Additionally enable ACPI function tracing" 324 bool "Additionally enable ACPI function tracing"
@@ -324,14 +328,6 @@ config ACPI_DEBUG_FUNC_TRACE
324 ACPI Debug Statements slow down ACPI processing. Function trace 328 ACPI Debug Statements slow down ACPI processing. Function trace
325 is about half of the penalty and is rarely useful. 329 is about half of the penalty and is rarely useful.
326 330
327config ACPI_EC
328 bool
329 default y
330 help
331 This driver is required on some systems for the proper operation of
332 the battery and thermal drivers. If you are compiling for a
333 mobile system, say Y.
334
335config ACPI_PCI_SLOT 331config ACPI_PCI_SLOT
336 tristate "PCI slot detection driver" 332 tristate "PCI slot detection driver"
337 default n 333 default n
@@ -341,10 +337,6 @@ config ACPI_PCI_SLOT
341 help you correlate PCI bus addresses with the physical geography 337 help you correlate PCI bus addresses with the physical geography
342 of your slots. If you are unsure, say N. 338 of your slots. If you are unsure, say N.
343 339
344config ACPI_POWER
345 bool
346 default y
347
348config ACPI_SYSTEM 340config ACPI_SYSTEM
349 bool 341 bool
350 default y 342 default y
diff --git a/drivers/acpi/Makefile b/drivers/acpi/Makefile
index d91c027ece8f..3c0c93300f12 100644
--- a/drivers/acpi/Makefile
+++ b/drivers/acpi/Makefile
@@ -39,19 +39,23 @@ obj-y += sleep/
39obj-y += bus.o glue.o 39obj-y += bus.o glue.o
40obj-y += scan.o 40obj-y += scan.o
41# Keep EC driver first. Initialization of others depend on it. 41# Keep EC driver first. Initialization of others depend on it.
42obj-$(CONFIG_ACPI_EC) += ec.o 42obj-y += ec.o
43obj-$(CONFIG_ACPI_AC) += ac.o 43obj-$(CONFIG_ACPI_AC) += ac.o
44obj-$(CONFIG_ACPI_BATTERY) += battery.o 44obj-$(CONFIG_ACPI_BATTERY) += battery.o
45obj-$(CONFIG_ACPI_BUTTON) += button.o 45obj-$(CONFIG_ACPI_BUTTON) += button.o
46obj-$(CONFIG_ACPI_FAN) += fan.o 46obj-$(CONFIG_ACPI_FAN) += fan.o
47obj-$(CONFIG_ACPI_DOCK) += dock.o 47obj-$(CONFIG_ACPI_DOCK) += dock.o
48obj-$(CONFIG_ACPI_VIDEO) += video.o 48obj-$(CONFIG_ACPI_VIDEO) += video.o
49ifdef CONFIG_ACPI_VIDEO
50obj-y += video_detect.o
51endif
52
49obj-y += pci_root.o pci_link.o pci_irq.o pci_bind.o 53obj-y += pci_root.o pci_link.o pci_irq.o pci_bind.o
50obj-$(CONFIG_ACPI_PCI_SLOT) += pci_slot.o 54obj-$(CONFIG_ACPI_PCI_SLOT) += pci_slot.o
51obj-$(CONFIG_ACPI_PROCESSOR) += processor.o 55obj-$(CONFIG_ACPI_PROCESSOR) += processor.o
52obj-$(CONFIG_ACPI_CONTAINER) += container.o 56obj-$(CONFIG_ACPI_CONTAINER) += container.o
53obj-$(CONFIG_ACPI_THERMAL) += thermal.o 57obj-$(CONFIG_ACPI_THERMAL) += thermal.o
54obj-$(CONFIG_ACPI_POWER) += power.o 58obj-y += power.o
55obj-$(CONFIG_ACPI_SYSTEM) += system.o event.o 59obj-$(CONFIG_ACPI_SYSTEM) += system.o event.o
56obj-$(CONFIG_ACPI_DEBUG) += debug.o 60obj-$(CONFIG_ACPI_DEBUG) += debug.o
57obj-$(CONFIG_ACPI_NUMA) += numa.o 61obj-$(CONFIG_ACPI_NUMA) += numa.o
diff --git a/drivers/acpi/ac.c b/drivers/acpi/ac.c
index d72a1b6c8a94..9b917dac7732 100644
--- a/drivers/acpi/ac.c
+++ b/drivers/acpi/ac.c
@@ -37,7 +37,6 @@
37#include <acpi/acpi_bus.h> 37#include <acpi/acpi_bus.h>
38#include <acpi/acpi_drivers.h> 38#include <acpi/acpi_drivers.h>
39 39
40#define ACPI_AC_COMPONENT 0x00020000
41#define ACPI_AC_CLASS "ac_adapter" 40#define ACPI_AC_CLASS "ac_adapter"
42#define ACPI_AC_DEVICE_NAME "AC Adapter" 41#define ACPI_AC_DEVICE_NAME "AC Adapter"
43#define ACPI_AC_FILE_STATE "state" 42#define ACPI_AC_FILE_STATE "state"
@@ -242,7 +241,7 @@ static void acpi_ac_notify(acpi_handle handle, u32 event, void *data)
242 acpi_ac_get_state(ac); 241 acpi_ac_get_state(ac);
243 acpi_bus_generate_proc_event(device, event, (u32) ac->state); 242 acpi_bus_generate_proc_event(device, event, (u32) ac->state);
244 acpi_bus_generate_netlink_event(device->pnp.device_class, 243 acpi_bus_generate_netlink_event(device->pnp.device_class,
245 device->dev.bus_id, event, 244 dev_name(&device->dev), event,
246 (u32) ac->state); 245 (u32) ac->state);
247#ifdef CONFIG_ACPI_SYSFS_POWER 246#ifdef CONFIG_ACPI_SYSFS_POWER
248 kobject_uevent(&ac->charger.dev->kobj, KOBJ_CHANGE); 247 kobject_uevent(&ac->charger.dev->kobj, KOBJ_CHANGE);
diff --git a/drivers/acpi/acpi_memhotplug.c b/drivers/acpi/acpi_memhotplug.c
index 71d21c51c45f..63a17b55b39b 100644
--- a/drivers/acpi/acpi_memhotplug.c
+++ b/drivers/acpi/acpi_memhotplug.c
@@ -32,7 +32,6 @@
32#include <linux/memory_hotplug.h> 32#include <linux/memory_hotplug.h>
33#include <acpi/acpi_drivers.h> 33#include <acpi/acpi_drivers.h>
34 34
35#define ACPI_MEMORY_DEVICE_COMPONENT 0x08000000UL
36#define ACPI_MEMORY_DEVICE_CLASS "memory" 35#define ACPI_MEMORY_DEVICE_CLASS "memory"
37#define ACPI_MEMORY_DEVICE_HID "PNP0C80" 36#define ACPI_MEMORY_DEVICE_HID "PNP0C80"
38#define ACPI_MEMORY_DEVICE_NAME "Hotplug Mem Device" 37#define ACPI_MEMORY_DEVICE_NAME "Hotplug Mem Device"
diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c
index b2133e89ad9a..1423b0c0cd2e 100644
--- a/drivers/acpi/battery.c
+++ b/drivers/acpi/battery.c
@@ -46,7 +46,6 @@
46 46
47#define ACPI_BATTERY_VALUE_UNKNOWN 0xFFFFFFFF 47#define ACPI_BATTERY_VALUE_UNKNOWN 0xFFFFFFFF
48 48
49#define ACPI_BATTERY_COMPONENT 0x00040000
50#define ACPI_BATTERY_CLASS "battery" 49#define ACPI_BATTERY_CLASS "battery"
51#define ACPI_BATTERY_DEVICE_NAME "Battery" 50#define ACPI_BATTERY_DEVICE_NAME "Battery"
52#define ACPI_BATTERY_NOTIFY_STATUS 0x80 51#define ACPI_BATTERY_NOTIFY_STATUS 0x80
@@ -782,7 +781,7 @@ static void acpi_battery_notify(acpi_handle handle, u32 event, void *data)
782 acpi_bus_generate_proc_event(device, event, 781 acpi_bus_generate_proc_event(device, event,
783 acpi_battery_present(battery)); 782 acpi_battery_present(battery));
784 acpi_bus_generate_netlink_event(device->pnp.device_class, 783 acpi_bus_generate_netlink_event(device->pnp.device_class,
785 device->dev.bus_id, event, 784 dev_name(&device->dev), event,
786 acpi_battery_present(battery)); 785 acpi_battery_present(battery));
787#ifdef CONFIG_ACPI_SYSFS_POWER 786#ifdef CONFIG_ACPI_SYSFS_POWER
788 /* acpi_batter_update could remove power_supply object */ 787 /* acpi_batter_update could remove power_supply object */
diff --git a/drivers/acpi/blacklist.c b/drivers/acpi/blacklist.c
index ea92bac42c53..09c69806c1fc 100644
--- a/drivers/acpi/blacklist.c
+++ b/drivers/acpi/blacklist.c
@@ -176,16 +176,6 @@ static int __init dmi_enable_osi_linux(const struct dmi_system_id *d)
176 acpi_dmi_osi_linux(1, d); /* enable */ 176 acpi_dmi_osi_linux(1, d); /* enable */
177 return 0; 177 return 0;
178} 178}
179static int __init dmi_disable_osi_linux(const struct dmi_system_id *d)
180{
181 acpi_dmi_osi_linux(0, d); /* disable */
182 return 0;
183}
184static int __init dmi_unknown_osi_linux(const struct dmi_system_id *d)
185{
186 acpi_dmi_osi_linux(-1, d); /* unknown */
187 return 0;
188}
189static int __init dmi_disable_osi_vista(const struct dmi_system_id *d) 179static int __init dmi_disable_osi_vista(const struct dmi_system_id *d)
190{ 180{
191 printk(KERN_NOTICE PREFIX "DMI detected: %s\n", d->ident); 181 printk(KERN_NOTICE PREFIX "DMI detected: %s\n", d->ident);
@@ -193,295 +183,21 @@ static int __init dmi_disable_osi_vista(const struct dmi_system_id *d)
193 return 0; 183 return 0;
194} 184}
195 185
196/*
197 * Most BIOS that invoke OSI(Linux) do nothing with it.
198 * But some cause Linux to break.
199 * Only a couple use it to make Linux run better.
200 *
201 * Thus, Linux should continue to disable OSI(Linux) by default,
202 * should continue to discourage BIOS writers from using it, and
203 * should whitelist the few existing systems that require it.
204 *
205 * If it appears clear a vendor isn't using OSI(Linux)
206 * for anything constructive, blacklist them by name to disable
207 * unnecessary dmesg warnings on all of their products.
208 */
209
210static struct dmi_system_id acpi_osi_dmi_table[] __initdata = { 186static struct dmi_system_id acpi_osi_dmi_table[] __initdata = {
211 /*
212 * Disable OSI(Linux) warnings on all "Acer, inc."
213 *
214 * _OSI(Linux) disables the latest Windows BIOS code:
215 * DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 3100"),
216 * DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5050"),
217 * DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5100"),
218 * DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5580"),
219 * DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 3010"),
220 * _OSI(Linux) effect unknown:
221 * DMI_MATCH(DMI_PRODUCT_NAME, "Ferrari 5000"),
222 */
223 /*
224 * note that dmi_check_system() uses strstr()
225 * to match sub-strings rather than !strcmp(),
226 * so "Acer" below matches "Acer, inc." above.
227 */
228 /*
229 * Disable OSI(Linux) warnings on all "Acer"
230 *
231 * _OSI(Linux) effect unknown:
232 * DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5610"),
233 * DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 7720Z"),
234 * DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 5520"),
235 * DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 6460"),
236 * DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 7510"),
237 *
238 * _OSI(Linux) is a NOP:
239 * DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5315"),
240 * DMI_MATCH(DMI_PRODUCT_NAME, "Extensa 5220"),
241 */
242 {
243 .callback = dmi_disable_osi_linux,
244 .ident = "Acer",
245 .matches = {
246 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
247 },
248 },
249 /*
250 * Disable OSI(Linux) warnings on all "Apple Computer, Inc."
251 * Disable OSI(Linux) warnings on all "Apple Inc."
252 *
253 * _OSI(Linux) confirmed to be a NOP:
254 * DMI_MATCH(DMI_PRODUCT_NAME, "MacBook1,1"),
255 * DMI_MATCH(DMI_PRODUCT_NAME, "MacBook2,1"),
256 * DMI_MATCH(DMI_PRODUCT_NAME, "MacBookPro2,2"),
257 * DMI_MATCH(DMI_PRODUCT_NAME, "MacBookPro3,1"),
258 * _OSI(Linux) effect unknown:
259 * DMI_MATCH(DMI_PRODUCT_NAME, "MacPro2,1"),
260 * DMI_MATCH(DMI_PRODUCT_NAME, "MacBookPro1,1"),
261 */
262 {
263 .callback = dmi_disable_osi_linux,
264 .ident = "Apple",
265 .matches = {
266 DMI_MATCH(DMI_SYS_VENDOR, "Apple"),
267 },
268 },
269 /*
270 * Disable OSI(Linux) warnings on all "BenQ"
271 *
272 * _OSI(Linux) confirmed to be a NOP:
273 * DMI_MATCH(DMI_PRODUCT_NAME, "Joybook S31"),
274 */
275 {
276 .callback = dmi_disable_osi_linux,
277 .ident = "BenQ",
278 .matches = {
279 DMI_MATCH(DMI_SYS_VENDOR, "BenQ"),
280 },
281 },
282 /*
283 * Disable OSI(Linux) warnings on all "Clevo Co."
284 *
285 * _OSI(Linux) confirmed to be a NOP:
286 * DMI_MATCH(DMI_PRODUCT_NAME, "M570RU"),
287 */
288 {
289 .callback = dmi_disable_osi_linux,
290 .ident = "Clevo",
291 .matches = {
292 DMI_MATCH(DMI_SYS_VENDOR, "Clevo Co."),
293 },
294 },
295 /*
296 * Disable OSI(Linux) warnings on all "COMPAL"
297 *
298 * _OSI(Linux) confirmed to be a NOP:
299 * DMI_MATCH(DMI_BOARD_NAME, "HEL8X"),
300 * _OSI(Linux) unknown effect:
301 * DMI_MATCH(DMI_BOARD_NAME, "IFL91"),
302 */
303 {
304 .callback = dmi_disable_osi_linux,
305 .ident = "Compal",
306 .matches = {
307 DMI_MATCH(DMI_BIOS_VENDOR, "COMPAL"),
308 },
309 },
310 { /* OSI(Linux) touches USB, unknown side-effect */
311 .callback = dmi_disable_osi_linux,
312 .ident = "Dell Dimension 5150",
313 .matches = {
314 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
315 DMI_MATCH(DMI_PRODUCT_NAME, "Dell DM051"),
316 },
317 },
318 { /* OSI(Linux) is a NOP */
319 .callback = dmi_disable_osi_linux,
320 .ident = "Dell i1501",
321 .matches = {
322 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
323 DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron 1501"),
324 },
325 },
326 { /* OSI(Linux) effect unknown */
327 .callback = dmi_unknown_osi_linux,
328 .ident = "Dell Latitude D830",
329 .matches = {
330 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
331 DMI_MATCH(DMI_PRODUCT_NAME, "Latitude D830"),
332 },
333 },
334 { /* OSI(Linux) effect unknown */
335 .callback = dmi_unknown_osi_linux,
336 .ident = "Dell OptiPlex GX620",
337 .matches = {
338 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
339 DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex GX620"),
340 },
341 },
342 { /* OSI(Linux) causes some USB initialization to not run */
343 .callback = dmi_unknown_osi_linux,
344 .ident = "Dell OptiPlex 755",
345 .matches = {
346 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
347 DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 755"),
348 },
349 },
350 { /* OSI(Linux) effect unknown */
351 .callback = dmi_unknown_osi_linux,
352 .ident = "Dell PE 1900",
353 .matches = {
354 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
355 DMI_MATCH(DMI_PRODUCT_NAME, "PowerEdge 1900"),
356 },
357 },
358 { /* OSI(Linux) is a NOP */
359 .callback = dmi_unknown_osi_linux,
360 .ident = "Dell PE 1950",
361 .matches = {
362 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
363 DMI_MATCH(DMI_PRODUCT_NAME, "PowerEdge 1950"),
364 },
365 },
366 { /* OSI(Linux) is a NOP */
367 .callback = dmi_disable_osi_linux,
368 .ident = "Dell PE R200",
369 .matches = {
370 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
371 DMI_MATCH(DMI_PRODUCT_NAME, "PowerEdge R200"),
372 },
373 },
374 { /* OSI(Linux) touches USB */
375 .callback = dmi_disable_osi_linux,
376 .ident = "Dell PR 390",
377 .matches = {
378 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
379 DMI_MATCH(DMI_PRODUCT_NAME, "Precision WorkStation 390"),
380 },
381 },
382 { /* OSI(Linux) touches USB */
383 .callback = dmi_unknown_osi_linux,
384 .ident = "Dell PR 390",
385 .matches = {
386 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
387 DMI_MATCH(DMI_PRODUCT_NAME, "Precision WorkStation 690"),
388 },
389 },
390 { /* OSI(Linux) unknown - ASL looks benign, but may effect dock/SMM */
391 .callback = dmi_unknown_osi_linux,
392 .ident = "Dell PR M4300",
393 .matches = {
394 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
395 DMI_MATCH(DMI_PRODUCT_NAME, "Precision M4300"),
396 },
397 },
398 { /* OSI(Linux) is a NOP */
399 .callback = dmi_disable_osi_linux,
400 .ident = "Dell Vostro 1000",
401 .matches = {
402 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
403 DMI_MATCH(DMI_PRODUCT_NAME, "Vostro 1000"),
404 },
405 },
406 { /* OSI(Linux) effect unknown */
407 .callback = dmi_unknown_osi_linux,
408 .ident = "Dell PE SC440",
409 .matches = {
410 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
411 DMI_MATCH(DMI_PRODUCT_NAME, "PowerEdge SC440"),
412 },
413 },
414 { /* OSI(Linux) effect unknown */
415 .callback = dmi_unknown_osi_linux,
416 .ident = "Dialogue Flybook V5",
417 .matches = {
418 DMI_MATCH(DMI_SYS_VENDOR, "Dialogue Technology Corporation"),
419 DMI_MATCH(DMI_PRODUCT_NAME, "Flybook V5"),
420 },
421 },
422 /*
423 * Disable OSI(Linux) warnings on all "FUJITSU SIEMENS"
424 *
425 * _OSI(Linux) disables latest Windows BIOS code:
426 * DMI_MATCH(DMI_PRODUCT_NAME, "AMILO Pa 2510"),
427 * _OSI(Linux) confirmed to be a NOP:
428 * DMI_MATCH(DMI_PRODUCT_NAME, "AMILO Pi 1536"),
429 * DMI_MATCH(DMI_PRODUCT_NAME, "AMILO Pi 1556"),
430 * DMI_MATCH(DMI_PRODUCT_NAME, "AMILO Xi 1546"),
431 * DMI_MATCH(DMI_PRODUCT_NAME, "ESPRIMO Mobile V5505"),
432 * _OSI(Linux) unknown effect:
433 * DMI_MATCH(DMI_PRODUCT_NAME, "Amilo M1425"),
434 * DMI_MATCH(DMI_PRODUCT_NAME, "Amilo Si 1520"),
435 */
436 {
437 .callback = dmi_disable_osi_linux,
438 .ident = "Fujitsu Siemens",
439 .matches = {
440 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
441 },
442 },
443 { 187 {
444 .callback = dmi_disable_osi_vista, 188 .callback = dmi_disable_osi_vista,
445 .ident = "Fujitsu Siemens", 189 .ident = "Fujitsu Siemens",
446 .matches = { 190 .matches = {
447 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"), 191 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
448 DMI_MATCH(DMI_PRODUCT_NAME, "ESPRIMO Mobile V5505"), 192 DMI_MATCH(DMI_PRODUCT_NAME, "ESPRIMO Mobile V5505"),
449 }, 193 },
450 }, 194 },
195
451 /* 196 /*
452 * Disable OSI(Linux) warnings on all "Hewlett-Packard" 197 * BIOS invocation of _OSI(Linux) is almost always a BIOS bug.
453 * 198 * Linux ignores it, except for the machines enumerated below.
454 * _OSI(Linux) confirmed to be a NOP:
455 * .ident = "HP Pavilion tx 1000"
456 * DMI_MATCH(DMI_BOARD_NAME, "30BF"),
457 * .ident = "HP Pavilion dv2000"
458 * DMI_MATCH(DMI_BOARD_NAME, "30B5"),
459 * .ident = "HP Pavilion dv5000",
460 * DMI_MATCH(DMI_BOARD_NAME, "30A7"),
461 * .ident = "HP Pavilion dv6300 30BC",
462 * DMI_MATCH(DMI_BOARD_NAME, "30BC"),
463 * .ident = "HP Pavilion dv6000",
464 * DMI_MATCH(DMI_BOARD_NAME, "30B7"),
465 * DMI_MATCH(DMI_BOARD_NAME, "30B8"),
466 * .ident = "HP Pavilion dv9000",
467 * DMI_MATCH(DMI_BOARD_NAME, "30B9"),
468 * .ident = "HP Pavilion dv9500",
469 * DMI_MATCH(DMI_BOARD_NAME, "30CB"),
470 * .ident = "HP/Compaq Presario C500",
471 * DMI_MATCH(DMI_BOARD_NAME, "30C6"),
472 * .ident = "HP/Compaq Presario F500",
473 * DMI_MATCH(DMI_BOARD_NAME, "30D3"),
474 * _OSI(Linux) unknown effect:
475 * .ident = "HP Pavilion dv6500",
476 * DMI_MATCH(DMI_BOARD_NAME, "30D0"),
477 */ 199 */
478 { 200
479 .callback = dmi_disable_osi_linux,
480 .ident = "Hewlett-Packard",
481 .matches = {
482 DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
483 },
484 },
485 /* 201 /*
486 * Lenovo has a mix of systems OSI(Linux) situations 202 * Lenovo has a mix of systems OSI(Linux) situations
487 * and thus we can not wildcard the vendor. 203 * and thus we can not wildcard the vendor.
@@ -519,113 +235,6 @@ static struct dmi_system_id acpi_osi_dmi_table[] __initdata = {
519 DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad X61"), 235 DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad X61"),
520 }, 236 },
521 }, 237 },
522 {
523 .callback = dmi_disable_osi_linux,
524 .ident = "Lenovo 3000 V100",
525 .matches = {
526 DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
527 DMI_MATCH(DMI_PRODUCT_VERSION, "LENOVO3000 V100"),
528 },
529 },
530 {
531 .callback = dmi_disable_osi_linux,
532 .ident = "Lenovo 3000 N100",
533 .matches = {
534 DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
535 DMI_MATCH(DMI_PRODUCT_VERSION, "3000 N100"),
536 },
537 },
538 /*
539 * Disable OSI(Linux) warnings on all "LG Electronics"
540 *
541 * _OSI(Linux) confirmed to be a NOP:
542 * DMI_MATCH(DMI_PRODUCT_NAME, "P1-J150B"),
543 * with DMI_MATCH(DMI_BOARD_NAME, "ROCKY"),
544 *
545 * unknown:
546 * DMI_MATCH(DMI_PRODUCT_NAME, "S1-MDGDG"),
547 * with DMI_MATCH(DMI_BOARD_NAME, "ROCKY"),
548 */
549 {
550 .callback = dmi_disable_osi_linux,
551 .ident = "LG",
552 .matches = {
553 DMI_MATCH(DMI_SYS_VENDOR, "LG Electronics"),
554 },
555 },
556 /* NEC - OSI(Linux) effect unknown */
557 {
558 .callback = dmi_unknown_osi_linux,
559 .ident = "NEC VERSA M360",
560 .matches = {
561 DMI_MATCH(DMI_SYS_VENDOR, "NEC Computers SAS"),
562 DMI_MATCH(DMI_PRODUCT_NAME, "NEC VERSA M360"),
563 },
564 },
565 /* Panasonic */
566 {
567 .callback = dmi_unknown_osi_linux,
568 .ident = "Panasonic",
569 .matches = {
570 DMI_MATCH(DMI_SYS_VENDOR, "Matsushita"),
571 /* Toughbook CF-52 */
572 DMI_MATCH(DMI_PRODUCT_NAME, "CF-52CCABVBG"),
573 },
574 },
575 /*
576 * Disable OSI(Linux) warnings on all "Samsung Electronics"
577 *
578 * OSI(Linux) disables PNP0C32 and other BIOS code for Windows:
579 * DMI_MATCH(DMI_PRODUCT_NAME, "R40P/R41P"),
580 * DMI_MATCH(DMI_PRODUCT_NAME, "R59P/R60P/R61P"),
581 */
582 {
583 .callback = dmi_disable_osi_linux,
584 .ident = "Samsung",
585 .matches = {
586 DMI_MATCH(DMI_SYS_VENDOR, "SAMSUNG ELECTRONICS CO., LTD."),
587 },
588 },
589 /*
590 * Disable OSI(Linux) warnings on all "Sony Corporation"
591 *
592 * _OSI(Linux) is a NOP:
593 * DMI_MATCH(DMI_PRODUCT_NAME, "VGN-NR11S_S"),
594 * DMI_MATCH(DMI_PRODUCT_NAME, "VGN-SZ38GP_C"),
595 * DMI_MATCH(DMI_PRODUCT_NAME, "VGN-SZ650N"),
596 * DMI_MATCH(DMI_PRODUCT_NAME, "VGN-TZ21MN_N"),
597 * _OSI(Linux) unknown effect:
598 * DMI_MATCH(DMI_PRODUCT_NAME, "VGN-FZ11M"),
599 */
600 {
601 .callback = dmi_disable_osi_linux,
602 .ident = "Sony",
603 .matches = {
604 DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
605 },
606 },
607 /*
608 * Disable OSI(Linux) warnings on all "TOSHIBA"
609 *
610 * _OSI(Linux) breaks sound (bugzilla 7787):
611 * DMI_MATCH(DMI_PRODUCT_NAME, "Satellite P100"),
612 * DMI_MATCH(DMI_PRODUCT_NAME, "Satellite P105"),
613 * _OSI(Linux) is a NOP:
614 * DMI_MATCH(DMI_PRODUCT_NAME, "Satellite A100"),
615 * DMI_MATCH(DMI_PRODUCT_NAME, "Satellite A210"),
616 * _OSI(Linux) unknown effect:
617 * DMI_MATCH(DMI_PRODUCT_NAME, "Satellite A135"),
618 * DMI_MATCH(DMI_PRODUCT_NAME, "Satellite A200"),
619 * DMI_MATCH(DMI_PRODUCT_NAME, "Satellite P205"),
620 * DMI_MATCH(DMI_PRODUCT_NAME, "Satellite U305"),
621 */
622 {
623 .callback = dmi_disable_osi_linux,
624 .ident = "Toshiba",
625 .matches = {
626 DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
627 },
628 },
629 {} 238 {}
630}; 239};
631 240
diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c
index c797c6473f31..7edf6d913c13 100644
--- a/drivers/acpi/bus.c
+++ b/drivers/acpi/bus.c
@@ -688,6 +688,14 @@ void __init acpi_early_init(void)
688 if (acpi_disabled) 688 if (acpi_disabled)
689 return; 689 return;
690 690
691 /*
692 * ACPI CA initializes acpi_dbg_level to non-zero, which means
693 * we get debug output merely by turning on CONFIG_ACPI_DEBUG.
694 * Turn it off so we don't get output unless the user specifies
695 * acpi.debug_level.
696 */
697 acpi_dbg_level = 0;
698
691 printk(KERN_INFO PREFIX "Core revision %08x\n", ACPI_CA_VERSION); 699 printk(KERN_INFO PREFIX "Core revision %08x\n", ACPI_CA_VERSION);
692 700
693 /* enable workarounds, unless strict ACPI spec. compliance */ 701 /* enable workarounds, unless strict ACPI spec. compliance */
@@ -774,7 +782,7 @@ static int __init acpi_bus_init(void)
774 "Unable to initialize ACPI OS objects\n"); 782 "Unable to initialize ACPI OS objects\n");
775 goto error1; 783 goto error1;
776 } 784 }
777#ifdef CONFIG_ACPI_EC 785
778 /* 786 /*
779 * ACPI 2.0 requires the EC driver to be loaded and work before 787 * ACPI 2.0 requires the EC driver to be loaded and work before
780 * the EC device is found in the namespace (i.e. before acpi_initialize_objects() 788 * the EC device is found in the namespace (i.e. before acpi_initialize_objects()
@@ -785,7 +793,6 @@ static int __init acpi_bus_init(void)
785 */ 793 */
786 status = acpi_ec_ecdt_probe(); 794 status = acpi_ec_ecdt_probe();
787 /* Ignore result. Not having an ECDT is not fatal. */ 795 /* Ignore result. Not having an ECDT is not fatal. */
788#endif
789 796
790 status = acpi_initialize_objects(ACPI_FULL_INITIALIZATION); 797 status = acpi_initialize_objects(ACPI_FULL_INITIALIZATION);
791 if (ACPI_FAILURE(status)) { 798 if (ACPI_FAILURE(status)) {
diff --git a/drivers/acpi/button.c b/drivers/acpi/button.c
index cb046c3fc3f2..171fd914f435 100644
--- a/drivers/acpi/button.c
+++ b/drivers/acpi/button.c
@@ -33,7 +33,6 @@
33#include <acpi/acpi_bus.h> 33#include <acpi/acpi_bus.h>
34#include <acpi/acpi_drivers.h> 34#include <acpi/acpi_drivers.h>
35 35
36#define ACPI_BUTTON_COMPONENT 0x00080000
37#define ACPI_BUTTON_CLASS "button" 36#define ACPI_BUTTON_CLASS "button"
38#define ACPI_BUTTON_FILE_INFO "info" 37#define ACPI_BUTTON_FILE_INFO "info"
39#define ACPI_BUTTON_FILE_STATE "state" 38#define ACPI_BUTTON_FILE_STATE "state"
@@ -479,7 +478,7 @@ static int acpi_button_add(struct acpi_device *device)
479 device->wakeup.gpe_number, 478 device->wakeup.gpe_number,
480 ACPI_GPE_TYPE_WAKE_RUN); 479 ACPI_GPE_TYPE_WAKE_RUN);
481 acpi_enable_gpe(device->wakeup.gpe_device, 480 acpi_enable_gpe(device->wakeup.gpe_device,
482 device->wakeup.gpe_number, ACPI_NOT_ISR); 481 device->wakeup.gpe_number);
483 device->wakeup.state.enabled = 1; 482 device->wakeup.state.enabled = 1;
484 } 483 }
485 484
diff --git a/drivers/acpi/cm_sbs.c b/drivers/acpi/cm_sbs.c
index 4441e84b28a9..307963bd1043 100644
--- a/drivers/acpi/cm_sbs.c
+++ b/drivers/acpi/cm_sbs.c
@@ -34,7 +34,6 @@
34ACPI_MODULE_NAME("cm_sbs"); 34ACPI_MODULE_NAME("cm_sbs");
35#define ACPI_AC_CLASS "ac_adapter" 35#define ACPI_AC_CLASS "ac_adapter"
36#define ACPI_BATTERY_CLASS "battery" 36#define ACPI_BATTERY_CLASS "battery"
37#define ACPI_SBS_COMPONENT 0x00080000
38#define _COMPONENT ACPI_SBS_COMPONENT 37#define _COMPONENT ACPI_SBS_COMPONENT
39static struct proc_dir_entry *acpi_ac_dir; 38static struct proc_dir_entry *acpi_ac_dir;
40static struct proc_dir_entry *acpi_battery_dir; 39static struct proc_dir_entry *acpi_battery_dir;
@@ -105,9 +104,3 @@ void acpi_unlock_battery_dir(struct proc_dir_entry *acpi_battery_dir_param)
105 return; 104 return;
106} 105}
107EXPORT_SYMBOL(acpi_unlock_battery_dir); 106EXPORT_SYMBOL(acpi_unlock_battery_dir);
108
109static int __init acpi_cm_sbs_init(void)
110{
111 return 0;
112}
113subsys_initcall(acpi_cm_sbs_init);
diff --git a/drivers/acpi/container.c b/drivers/acpi/container.c
index 134818b265a9..17020c12623c 100644
--- a/drivers/acpi/container.c
+++ b/drivers/acpi/container.c
@@ -41,7 +41,6 @@
41#define INSTALL_NOTIFY_HANDLER 1 41#define INSTALL_NOTIFY_HANDLER 1
42#define UNINSTALL_NOTIFY_HANDLER 2 42#define UNINSTALL_NOTIFY_HANDLER 2
43 43
44#define ACPI_CONTAINER_COMPONENT 0x01000000
45#define _COMPONENT ACPI_CONTAINER_COMPONENT 44#define _COMPONENT ACPI_CONTAINER_COMPONENT
46ACPI_MODULE_NAME("container"); 45ACPI_MODULE_NAME("container");
47 46
diff --git a/drivers/acpi/debug.c b/drivers/acpi/debug.c
index abf36b4b1d1d..c48396892008 100644
--- a/drivers/acpi/debug.c
+++ b/drivers/acpi/debug.c
@@ -44,6 +44,21 @@ static const struct acpi_dlayer acpi_debug_layers[] = {
44 ACPI_DEBUG_INIT(ACPI_CA_DISASSEMBLER), 44 ACPI_DEBUG_INIT(ACPI_CA_DISASSEMBLER),
45 ACPI_DEBUG_INIT(ACPI_COMPILER), 45 ACPI_DEBUG_INIT(ACPI_COMPILER),
46 ACPI_DEBUG_INIT(ACPI_TOOLS), 46 ACPI_DEBUG_INIT(ACPI_TOOLS),
47
48 ACPI_DEBUG_INIT(ACPI_BUS_COMPONENT),
49 ACPI_DEBUG_INIT(ACPI_AC_COMPONENT),
50 ACPI_DEBUG_INIT(ACPI_BATTERY_COMPONENT),
51 ACPI_DEBUG_INIT(ACPI_BUTTON_COMPONENT),
52 ACPI_DEBUG_INIT(ACPI_SBS_COMPONENT),
53 ACPI_DEBUG_INIT(ACPI_FAN_COMPONENT),
54 ACPI_DEBUG_INIT(ACPI_PCI_COMPONENT),
55 ACPI_DEBUG_INIT(ACPI_POWER_COMPONENT),
56 ACPI_DEBUG_INIT(ACPI_CONTAINER_COMPONENT),
57 ACPI_DEBUG_INIT(ACPI_SYSTEM_COMPONENT),
58 ACPI_DEBUG_INIT(ACPI_THERMAL_COMPONENT),
59 ACPI_DEBUG_INIT(ACPI_MEMORY_DEVICE_COMPONENT),
60 ACPI_DEBUG_INIT(ACPI_VIDEO_COMPONENT),
61 ACPI_DEBUG_INIT(ACPI_PROCESSOR_COMPONENT),
47}; 62};
48 63
49static const struct acpi_dlevel acpi_debug_levels[] = { 64static const struct acpi_dlevel acpi_debug_levels[] = {
diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c
index ef42316f89f5..30f3ef236ecb 100644
--- a/drivers/acpi/ec.c
+++ b/drivers/acpi/ec.c
@@ -70,7 +70,7 @@ enum ec_command {
70#define ACPI_EC_UDELAY_GLK 1000 /* Wait 1ms max. to get global lock */ 70#define ACPI_EC_UDELAY_GLK 1000 /* Wait 1ms max. to get global lock */
71#define ACPI_EC_UDELAY 100 /* Wait 100us before polling EC again */ 71#define ACPI_EC_UDELAY 100 /* Wait 100us before polling EC again */
72 72
73#define ACPI_EC_STORM_THRESHOLD 20 /* number of false interrupts 73#define ACPI_EC_STORM_THRESHOLD 8 /* number of false interrupts
74 per one transaction */ 74 per one transaction */
75 75
76enum { 76enum {
@@ -100,8 +100,11 @@ struct transaction {
100 u8 *rdata; 100 u8 *rdata;
101 unsigned short irq_count; 101 unsigned short irq_count;
102 u8 command; 102 u8 command;
103 u8 wi;
104 u8 ri;
103 u8 wlen; 105 u8 wlen;
104 u8 rlen; 106 u8 rlen;
107 bool done;
105}; 108};
106 109
107static struct acpi_ec { 110static struct acpi_ec {
@@ -178,34 +181,46 @@ static int ec_transaction_done(struct acpi_ec *ec)
178 unsigned long flags; 181 unsigned long flags;
179 int ret = 0; 182 int ret = 0;
180 spin_lock_irqsave(&ec->curr_lock, flags); 183 spin_lock_irqsave(&ec->curr_lock, flags);
181 if (!ec->curr || (!ec->curr->wlen && !ec->curr->rlen)) 184 if (!ec->curr || ec->curr->done)
182 ret = 1; 185 ret = 1;
183 spin_unlock_irqrestore(&ec->curr_lock, flags); 186 spin_unlock_irqrestore(&ec->curr_lock, flags);
184 return ret; 187 return ret;
185} 188}
186 189
190static void start_transaction(struct acpi_ec *ec)
191{
192 ec->curr->irq_count = ec->curr->wi = ec->curr->ri = 0;
193 ec->curr->done = false;
194 acpi_ec_write_cmd(ec, ec->curr->command);
195}
196
187static void gpe_transaction(struct acpi_ec *ec, u8 status) 197static void gpe_transaction(struct acpi_ec *ec, u8 status)
188{ 198{
189 unsigned long flags; 199 unsigned long flags;
190 spin_lock_irqsave(&ec->curr_lock, flags); 200 spin_lock_irqsave(&ec->curr_lock, flags);
191 if (!ec->curr) 201 if (!ec->curr)
192 goto unlock; 202 goto unlock;
193 if (ec->curr->wlen > 0) { 203 if (ec->curr->wlen > ec->curr->wi) {
194 if ((status & ACPI_EC_FLAG_IBF) == 0) { 204 if ((status & ACPI_EC_FLAG_IBF) == 0)
195 acpi_ec_write_data(ec, *(ec->curr->wdata++)); 205 acpi_ec_write_data(ec,
196 --ec->curr->wlen; 206 ec->curr->wdata[ec->curr->wi++]);
197 } else 207 else
198 /* false interrupt, state didn't change */ 208 goto err;
199 ++ec->curr->irq_count; 209 } else if (ec->curr->rlen > ec->curr->ri) {
200
201 } else if (ec->curr->rlen > 0) {
202 if ((status & ACPI_EC_FLAG_OBF) == 1) { 210 if ((status & ACPI_EC_FLAG_OBF) == 1) {
203 *(ec->curr->rdata++) = acpi_ec_read_data(ec); 211 ec->curr->rdata[ec->curr->ri++] = acpi_ec_read_data(ec);
204 --ec->curr->rlen; 212 if (ec->curr->rlen == ec->curr->ri)
213 ec->curr->done = true;
205 } else 214 } else
206 /* false interrupt, state didn't change */ 215 goto err;
207 ++ec->curr->irq_count; 216 } else if (ec->curr->wlen == ec->curr->wi &&
208 } 217 (status & ACPI_EC_FLAG_IBF) == 0)
218 ec->curr->done = true;
219 goto unlock;
220err:
221 /* false interrupt, state didn't change */
222 if (in_interrupt())
223 ++ec->curr->irq_count;
209unlock: 224unlock:
210 spin_unlock_irqrestore(&ec->curr_lock, flags); 225 spin_unlock_irqrestore(&ec->curr_lock, flags);
211} 226}
@@ -215,6 +230,15 @@ static int acpi_ec_wait(struct acpi_ec *ec)
215 if (wait_event_timeout(ec->wait, ec_transaction_done(ec), 230 if (wait_event_timeout(ec->wait, ec_transaction_done(ec),
216 msecs_to_jiffies(ACPI_EC_DELAY))) 231 msecs_to_jiffies(ACPI_EC_DELAY)))
217 return 0; 232 return 0;
233 /* try restart command if we get any false interrupts */
234 if (ec->curr->irq_count &&
235 (acpi_ec_read_status(ec) & ACPI_EC_FLAG_IBF) == 0) {
236 pr_debug(PREFIX "controller reset, restart transaction\n");
237 start_transaction(ec);
238 if (wait_event_timeout(ec->wait, ec_transaction_done(ec),
239 msecs_to_jiffies(ACPI_EC_DELAY)))
240 return 0;
241 }
218 /* missing GPEs, switch back to poll mode */ 242 /* missing GPEs, switch back to poll mode */
219 if (printk_ratelimit()) 243 if (printk_ratelimit())
220 pr_info(PREFIX "missing confirmations, " 244 pr_info(PREFIX "missing confirmations, "
@@ -239,10 +263,10 @@ static int ec_check_sci(struct acpi_ec *ec, u8 state)
239static int ec_poll(struct acpi_ec *ec) 263static int ec_poll(struct acpi_ec *ec)
240{ 264{
241 unsigned long delay = jiffies + msecs_to_jiffies(ACPI_EC_DELAY); 265 unsigned long delay = jiffies + msecs_to_jiffies(ACPI_EC_DELAY);
242 msleep(1); 266 udelay(ACPI_EC_UDELAY);
243 while (time_before(jiffies, delay)) { 267 while (time_before(jiffies, delay)) {
244 gpe_transaction(ec, acpi_ec_read_status(ec)); 268 gpe_transaction(ec, acpi_ec_read_status(ec));
245 msleep(1); 269 udelay(ACPI_EC_UDELAY);
246 if (ec_transaction_done(ec)) 270 if (ec_transaction_done(ec))
247 return 0; 271 return 0;
248 } 272 }
@@ -259,14 +283,13 @@ static int acpi_ec_transaction_unlocked(struct acpi_ec *ec,
259 /* disable GPE during transaction if storm is detected */ 283 /* disable GPE during transaction if storm is detected */
260 if (test_bit(EC_FLAGS_GPE_STORM, &ec->flags)) { 284 if (test_bit(EC_FLAGS_GPE_STORM, &ec->flags)) {
261 clear_bit(EC_FLAGS_GPE_MODE, &ec->flags); 285 clear_bit(EC_FLAGS_GPE_MODE, &ec->flags);
262 acpi_disable_gpe(NULL, ec->gpe, ACPI_NOT_ISR); 286 acpi_disable_gpe(NULL, ec->gpe);
263 } 287 }
264 /* start transaction */ 288 /* start transaction */
265 spin_lock_irqsave(&ec->curr_lock, tmp); 289 spin_lock_irqsave(&ec->curr_lock, tmp);
266 /* following two actions should be kept atomic */ 290 /* following two actions should be kept atomic */
267 t->irq_count = 0;
268 ec->curr = t; 291 ec->curr = t;
269 acpi_ec_write_cmd(ec, ec->curr->command); 292 start_transaction(ec);
270 if (ec->curr->command == ACPI_EC_COMMAND_QUERY) 293 if (ec->curr->command == ACPI_EC_COMMAND_QUERY)
271 clear_bit(EC_FLAGS_QUERY_PENDING, &ec->flags); 294 clear_bit(EC_FLAGS_QUERY_PENDING, &ec->flags);
272 spin_unlock_irqrestore(&ec->curr_lock, tmp); 295 spin_unlock_irqrestore(&ec->curr_lock, tmp);
@@ -283,10 +306,11 @@ static int acpi_ec_transaction_unlocked(struct acpi_ec *ec,
283 /* check if we received SCI during transaction */ 306 /* check if we received SCI during transaction */
284 ec_check_sci(ec, acpi_ec_read_status(ec)); 307 ec_check_sci(ec, acpi_ec_read_status(ec));
285 /* it is safe to enable GPE outside of transaction */ 308 /* it is safe to enable GPE outside of transaction */
286 acpi_enable_gpe(NULL, ec->gpe, ACPI_NOT_ISR); 309 acpi_enable_gpe(NULL, ec->gpe);
287 } else if (test_bit(EC_FLAGS_GPE_MODE, &ec->flags) && 310 } else if (test_bit(EC_FLAGS_GPE_MODE, &ec->flags) &&
288 t->irq_count > ACPI_EC_STORM_THRESHOLD) { 311 t->irq_count > ACPI_EC_STORM_THRESHOLD) {
289 pr_debug(PREFIX "GPE storm detected\n"); 312 pr_info(PREFIX "GPE storm detected, "
313 "transactions will use polling mode\n");
290 set_bit(EC_FLAGS_GPE_STORM, &ec->flags); 314 set_bit(EC_FLAGS_GPE_STORM, &ec->flags);
291 } 315 }
292 return ret; 316 return ret;
@@ -558,17 +582,26 @@ static u32 acpi_ec_gpe_handler(void *data)
558 pr_debug(PREFIX "~~~> interrupt\n"); 582 pr_debug(PREFIX "~~~> interrupt\n");
559 status = acpi_ec_read_status(ec); 583 status = acpi_ec_read_status(ec);
560 584
561 gpe_transaction(ec, status); 585 if (test_bit(EC_FLAGS_GPE_MODE, &ec->flags)) {
562 if (ec_transaction_done(ec) && (status & ACPI_EC_FLAG_IBF) == 0) 586 gpe_transaction(ec, status);
563 wake_up(&ec->wait); 587 if (ec_transaction_done(ec) &&
588 (status & ACPI_EC_FLAG_IBF) == 0)
589 wake_up(&ec->wait);
590 }
564 591
565 ec_check_sci(ec, status); 592 ec_check_sci(ec, status);
566 if (!test_bit(EC_FLAGS_GPE_MODE, &ec->flags) && 593 if (!test_bit(EC_FLAGS_GPE_MODE, &ec->flags) &&
567 !test_bit(EC_FLAGS_NO_GPE, &ec->flags)) { 594 !test_bit(EC_FLAGS_NO_GPE, &ec->flags)) {
568 /* this is non-query, must be confirmation */ 595 /* this is non-query, must be confirmation */
569 if (printk_ratelimit()) 596 if (!test_bit(EC_FLAGS_GPE_STORM, &ec->flags)) {
570 pr_info(PREFIX "non-query interrupt received," 597 if (printk_ratelimit())
598 pr_info(PREFIX "non-query interrupt received,"
599 " switching to interrupt mode\n");
600 } else {
601 /* hush, STORM switches the mode every transaction */
602 pr_debug(PREFIX "non-query interrupt received,"
571 " switching to interrupt mode\n"); 603 " switching to interrupt mode\n");
604 }
572 set_bit(EC_FLAGS_GPE_MODE, &ec->flags); 605 set_bit(EC_FLAGS_GPE_MODE, &ec->flags);
573 } 606 }
574 return ACPI_INTERRUPT_HANDLED; 607 return ACPI_INTERRUPT_HANDLED;
@@ -736,7 +769,7 @@ static acpi_status
736ec_parse_device(acpi_handle handle, u32 Level, void *context, void **retval) 769ec_parse_device(acpi_handle handle, u32 Level, void *context, void **retval)
737{ 770{
738 acpi_status status; 771 acpi_status status;
739 unsigned long long tmp; 772 unsigned long long tmp = 0;
740 773
741 struct acpi_ec *ec = context; 774 struct acpi_ec *ec = context;
742 status = acpi_walk_resources(handle, METHOD_NAME__CRS, 775 status = acpi_walk_resources(handle, METHOD_NAME__CRS,
@@ -751,6 +784,7 @@ ec_parse_device(acpi_handle handle, u32 Level, void *context, void **retval)
751 return status; 784 return status;
752 ec->gpe = tmp; 785 ec->gpe = tmp;
753 /* Use the global lock for all EC transactions? */ 786 /* Use the global lock for all EC transactions? */
787 tmp = 0;
754 acpi_evaluate_integer(handle, "_GLK", NULL, &tmp); 788 acpi_evaluate_integer(handle, "_GLK", NULL, &tmp);
755 ec->global_lock = tmp; 789 ec->global_lock = tmp;
756 ec->handle = handle; 790 ec->handle = handle;
@@ -868,7 +902,7 @@ static int ec_install_handlers(struct acpi_ec *ec)
868 if (ACPI_FAILURE(status)) 902 if (ACPI_FAILURE(status))
869 return -ENODEV; 903 return -ENODEV;
870 acpi_set_gpe_type(NULL, ec->gpe, ACPI_GPE_TYPE_RUNTIME); 904 acpi_set_gpe_type(NULL, ec->gpe, ACPI_GPE_TYPE_RUNTIME);
871 acpi_enable_gpe(NULL, ec->gpe, ACPI_NOT_ISR); 905 acpi_enable_gpe(NULL, ec->gpe);
872 status = acpi_install_address_space_handler(ec->handle, 906 status = acpi_install_address_space_handler(ec->handle,
873 ACPI_ADR_SPACE_EC, 907 ACPI_ADR_SPACE_EC,
874 &acpi_ec_space_handler, 908 &acpi_ec_space_handler,
@@ -1007,7 +1041,7 @@ static int acpi_ec_suspend(struct acpi_device *device, pm_message_t state)
1007 /* Stop using GPE */ 1041 /* Stop using GPE */
1008 set_bit(EC_FLAGS_NO_GPE, &ec->flags); 1042 set_bit(EC_FLAGS_NO_GPE, &ec->flags);
1009 clear_bit(EC_FLAGS_GPE_MODE, &ec->flags); 1043 clear_bit(EC_FLAGS_GPE_MODE, &ec->flags);
1010 acpi_disable_gpe(NULL, ec->gpe, ACPI_NOT_ISR); 1044 acpi_disable_gpe(NULL, ec->gpe);
1011 return 0; 1045 return 0;
1012} 1046}
1013 1047
@@ -1016,7 +1050,7 @@ static int acpi_ec_resume(struct acpi_device *device)
1016 struct acpi_ec *ec = acpi_driver_data(device); 1050 struct acpi_ec *ec = acpi_driver_data(device);
1017 /* Enable use of GPE back */ 1051 /* Enable use of GPE back */
1018 clear_bit(EC_FLAGS_NO_GPE, &ec->flags); 1052 clear_bit(EC_FLAGS_NO_GPE, &ec->flags);
1019 acpi_enable_gpe(NULL, ec->gpe, ACPI_NOT_ISR); 1053 acpi_enable_gpe(NULL, ec->gpe);
1020 return 0; 1054 return 0;
1021} 1055}
1022 1056
diff --git a/drivers/acpi/events/evgpe.c b/drivers/acpi/events/evgpe.c
index c5e53aae86f7..f45c74fe745e 100644
--- a/drivers/acpi/events/evgpe.c
+++ b/drivers/acpi/events/evgpe.c
@@ -289,8 +289,6 @@ acpi_status acpi_ev_disable_gpe(struct acpi_gpe_event_info *gpe_event_info)
289 */ 289 */
290 status = acpi_hw_low_disable_gpe(gpe_event_info); 290 status = acpi_hw_low_disable_gpe(gpe_event_info);
291 return_ACPI_STATUS(status); 291 return_ACPI_STATUS(status);
292
293 return_ACPI_STATUS(AE_OK);
294} 292}
295 293
296/******************************************************************************* 294/*******************************************************************************
diff --git a/drivers/acpi/events/evxfevnt.c b/drivers/acpi/events/evxfevnt.c
index 73bfd6bf962f..41554f736b68 100644
--- a/drivers/acpi/events/evxfevnt.c
+++ b/drivers/acpi/events/evxfevnt.c
@@ -248,21 +248,15 @@ ACPI_EXPORT_SYMBOL(acpi_set_gpe_type)
248 * DESCRIPTION: Enable an ACPI event (general purpose) 248 * DESCRIPTION: Enable an ACPI event (general purpose)
249 * 249 *
250 ******************************************************************************/ 250 ******************************************************************************/
251acpi_status acpi_enable_gpe(acpi_handle gpe_device, u32 gpe_number, u32 flags) 251acpi_status acpi_enable_gpe(acpi_handle gpe_device, u32 gpe_number)
252{ 252{
253 acpi_status status = AE_OK; 253 acpi_status status = AE_OK;
254 acpi_cpu_flags flags;
254 struct acpi_gpe_event_info *gpe_event_info; 255 struct acpi_gpe_event_info *gpe_event_info;
255 256
256 ACPI_FUNCTION_TRACE(acpi_enable_gpe); 257 ACPI_FUNCTION_TRACE(acpi_enable_gpe);
257 258
258 /* Use semaphore lock if not executing at interrupt level */ 259 flags = acpi_os_acquire_lock(acpi_gbl_gpe_lock);
259
260 if (flags & ACPI_NOT_ISR) {
261 status = acpi_ut_acquire_mutex(ACPI_MTX_EVENTS);
262 if (ACPI_FAILURE(status)) {
263 return_ACPI_STATUS(status);
264 }
265 }
266 260
267 /* Ensure that we have a valid GPE number */ 261 /* Ensure that we have a valid GPE number */
268 262
@@ -277,9 +271,7 @@ acpi_status acpi_enable_gpe(acpi_handle gpe_device, u32 gpe_number, u32 flags)
277 status = acpi_ev_enable_gpe(gpe_event_info, TRUE); 271 status = acpi_ev_enable_gpe(gpe_event_info, TRUE);
278 272
279 unlock_and_exit: 273 unlock_and_exit:
280 if (flags & ACPI_NOT_ISR) { 274 acpi_os_release_lock(acpi_gbl_gpe_lock, flags);
281 (void)acpi_ut_release_mutex(ACPI_MTX_EVENTS);
282 }
283 return_ACPI_STATUS(status); 275 return_ACPI_STATUS(status);
284} 276}
285 277
@@ -299,22 +291,15 @@ ACPI_EXPORT_SYMBOL(acpi_enable_gpe)
299 * DESCRIPTION: Disable an ACPI event (general purpose) 291 * DESCRIPTION: Disable an ACPI event (general purpose)
300 * 292 *
301 ******************************************************************************/ 293 ******************************************************************************/
302acpi_status acpi_disable_gpe(acpi_handle gpe_device, u32 gpe_number, u32 flags) 294acpi_status acpi_disable_gpe(acpi_handle gpe_device, u32 gpe_number)
303{ 295{
304 acpi_status status = AE_OK; 296 acpi_status status = AE_OK;
297 acpi_cpu_flags flags;
305 struct acpi_gpe_event_info *gpe_event_info; 298 struct acpi_gpe_event_info *gpe_event_info;
306 299
307 ACPI_FUNCTION_TRACE(acpi_disable_gpe); 300 ACPI_FUNCTION_TRACE(acpi_disable_gpe);
308 301
309 /* Use semaphore lock if not executing at interrupt level */ 302 flags = acpi_os_acquire_lock(acpi_gbl_gpe_lock);
310
311 if (flags & ACPI_NOT_ISR) {
312 status = acpi_ut_acquire_mutex(ACPI_MTX_EVENTS);
313 if (ACPI_FAILURE(status)) {
314 return_ACPI_STATUS(status);
315 }
316 }
317
318 /* Ensure that we have a valid GPE number */ 303 /* Ensure that we have a valid GPE number */
319 304
320 gpe_event_info = acpi_ev_get_gpe_event_info(gpe_device, gpe_number); 305 gpe_event_info = acpi_ev_get_gpe_event_info(gpe_device, gpe_number);
@@ -325,10 +310,8 @@ acpi_status acpi_disable_gpe(acpi_handle gpe_device, u32 gpe_number, u32 flags)
325 310
326 status = acpi_ev_disable_gpe(gpe_event_info); 311 status = acpi_ev_disable_gpe(gpe_event_info);
327 312
328 unlock_and_exit: 313unlock_and_exit:
329 if (flags & ACPI_NOT_ISR) { 314 acpi_os_release_lock(acpi_gbl_gpe_lock, flags);
330 (void)acpi_ut_release_mutex(ACPI_MTX_EVENTS);
331 }
332 return_ACPI_STATUS(status); 315 return_ACPI_STATUS(status);
333} 316}
334 317
@@ -521,6 +504,9 @@ acpi_status acpi_get_event_status(u32 event, acpi_event_status * event_status)
521 if (value) 504 if (value)
522 *event_status |= ACPI_EVENT_FLAG_SET; 505 *event_status |= ACPI_EVENT_FLAG_SET;
523 506
507 if (acpi_gbl_fixed_event_handlers[event].handler)
508 *event_status |= ACPI_EVENT_FLAG_HANDLE;
509
524 return_ACPI_STATUS(status); 510 return_ACPI_STATUS(status);
525} 511}
526 512
@@ -571,6 +557,9 @@ acpi_get_gpe_status(acpi_handle gpe_device,
571 557
572 status = acpi_hw_get_gpe_status(gpe_event_info, event_status); 558 status = acpi_hw_get_gpe_status(gpe_event_info, event_status);
573 559
560 if (gpe_event_info->flags & ACPI_GPE_DISPATCH_MASK)
561 *event_status |= ACPI_EVENT_FLAG_HANDLE;
562
574 unlock_and_exit: 563 unlock_and_exit:
575 if (flags & ACPI_NOT_ISR) { 564 if (flags & ACPI_NOT_ISR) {
576 (void)acpi_ut_release_mutex(ACPI_MTX_EVENTS); 565 (void)acpi_ut_release_mutex(ACPI_MTX_EVENTS);
diff --git a/drivers/acpi/fan.c b/drivers/acpi/fan.c
index 60d54d1f6b19..eaaee1660bdf 100644
--- a/drivers/acpi/fan.c
+++ b/drivers/acpi/fan.c
@@ -34,7 +34,6 @@
34#include <acpi/acpi_bus.h> 34#include <acpi/acpi_bus.h>
35#include <acpi/acpi_drivers.h> 35#include <acpi/acpi_drivers.h>
36 36
37#define ACPI_FAN_COMPONENT 0x00200000
38#define ACPI_FAN_CLASS "fan" 37#define ACPI_FAN_CLASS "fan"
39#define ACPI_FAN_FILE_STATE "state" 38#define ACPI_FAN_FILE_STATE "state"
40 39
diff --git a/drivers/acpi/glue.c b/drivers/acpi/glue.c
index 24649ada08df..adec3d15810a 100644
--- a/drivers/acpi/glue.c
+++ b/drivers/acpi/glue.c
@@ -140,6 +140,46 @@ struct device *acpi_get_physical_device(acpi_handle handle)
140 140
141EXPORT_SYMBOL(acpi_get_physical_device); 141EXPORT_SYMBOL(acpi_get_physical_device);
142 142
143/* ToDo: When a PCI bridge is found, return the PCI device behind the bridge
144 * This should work in general, but did not on a Lenovo T61 for the
145 * graphics card. But this must be fixed when the PCI device is
146 * bound and the kernel device struct is attached to the acpi device
147 * Note: A success call will increase reference count by one
148 * Do call put_device(dev) on the returned device then
149 */
150struct device *acpi_get_physical_pci_device(acpi_handle handle)
151{
152 struct device *dev;
153 long long device_id;
154 acpi_status status;
155
156 status =
157 acpi_evaluate_integer(handle, "_ADR", NULL, &device_id);
158
159 if (ACPI_FAILURE(status))
160 return NULL;
161
162 /* We need to attempt to determine whether the _ADR refers to a
163 PCI device or not. There's no terribly good way to do this,
164 so the best we can hope for is to assume that there'll never
165 be a device in the host bridge */
166 if (device_id >= 0x10000) {
167 /* It looks like a PCI device. Does it exist? */
168 dev = acpi_get_physical_device(handle);
169 } else {
170 /* It doesn't look like a PCI device. Does its parent
171 exist? */
172 acpi_handle phandle;
173 if (acpi_get_parent(handle, &phandle))
174 return NULL;
175 dev = acpi_get_physical_device(phandle);
176 }
177 if (!dev)
178 return NULL;
179 return dev;
180}
181EXPORT_SYMBOL(acpi_get_physical_pci_device);
182
143static int acpi_bind_one(struct device *dev, acpi_handle handle) 183static int acpi_bind_one(struct device *dev, acpi_handle handle)
144{ 184{
145 struct acpi_device *acpi_dev; 185 struct acpi_device *acpi_dev;
diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c
index 4be252145cb4..c8111424dcb8 100644
--- a/drivers/acpi/osl.c
+++ b/drivers/acpi/osl.c
@@ -35,7 +35,6 @@
35#include <linux/interrupt.h> 35#include <linux/interrupt.h>
36#include <linux/kmod.h> 36#include <linux/kmod.h>
37#include <linux/delay.h> 37#include <linux/delay.h>
38#include <linux/dmi.h>
39#include <linux/workqueue.h> 38#include <linux/workqueue.h>
40#include <linux/nmi.h> 39#include <linux/nmi.h>
41#include <linux/acpi.h> 40#include <linux/acpi.h>
@@ -97,54 +96,44 @@ static DEFINE_SPINLOCK(acpi_res_lock);
97static char osi_additional_string[OSI_STRING_LENGTH_MAX]; 96static char osi_additional_string[OSI_STRING_LENGTH_MAX];
98 97
99/* 98/*
100 * "Ode to _OSI(Linux)" 99 * The story of _OSI(Linux)
101 * 100 *
102 * osi_linux -- Control response to BIOS _OSI(Linux) query. 101 * From pre-history through Linux-2.6.22,
102 * Linux responded TRUE upon a BIOS OSI(Linux) query.
103 * 103 *
104 * As Linux evolves, the features that it supports change. 104 * Unfortunately, reference BIOS writers got wind of this
105 * So an OSI string such as "Linux" is not specific enough 105 * and put OSI(Linux) in their example code, quickly exposing
106 * to be useful across multiple versions of Linux. It 106 * this string as ill-conceived and opening the door to
107 * doesn't identify any particular feature, interface, 107 * an un-bounded number of BIOS incompatibilities.
108 * or even any particular version of Linux...
109 * 108 *
110 * Unfortunately, Linux-2.6.22 and earlier responded "yes" 109 * For example, OSI(Linux) was used on resume to re-POST a
111 * to a BIOS _OSI(Linux) query. When 110 * video card on one system, because Linux at that time
112 * a reference mobile BIOS started using it, its use 111 * could not do a speedy restore in its native driver.
113 * started to spread to many vendor platforms. 112 * But then upon gaining quick native restore capability,
114 * As it is not supportable, we need to halt that spread. 113 * Linux has no way to tell the BIOS to skip the time-consuming
114 * POST -- putting Linux at a permanent performance disadvantage.
115 * On another system, the BIOS writer used OSI(Linux)
116 * to infer native OS support for IPMI! On other systems,
117 * OSI(Linux) simply got in the way of Linux claiming to
118 * be compatible with other operating systems, exposing
119 * BIOS issues such as skipped device initialization.
115 * 120 *
116 * Today, most BIOS references to _OSI(Linux) are noise -- 121 * So "Linux" turned out to be a really poor chose of
117 * they have no functional effect and are just dead code 122 * OSI string, and from Linux-2.6.23 onward we respond FALSE.
118 * carried over from the reference BIOS.
119 *
120 * The next most common case is that _OSI(Linux) harms Linux,
121 * usually by causing the BIOS to follow paths that are
122 * not tested during Windows validation.
123 *
124 * Finally, there is a short list of platforms
125 * where OSI(Linux) benefits Linux.
126 *
127 * In Linux-2.6.23, OSI(Linux) is first disabled by default.
128 * DMI is used to disable the dmesg warning about OSI(Linux)
129 * on platforms where it is known to have no effect.
130 * But a dmesg warning remains for systems where
131 * we do not know if OSI(Linux) is good or bad for the system.
132 * DMI is also used to enable OSI(Linux) for the machines
133 * that are known to need it.
134 * 123 *
135 * BIOS writers should NOT query _OSI(Linux) on future systems. 124 * BIOS writers should NOT query _OSI(Linux) on future systems.
136 * It will be ignored by default, and to get Linux to 125 * Linux will complain on the console when it sees it, and return FALSE.
137 * not ignore it will require a kernel source update to 126 * To get Linux to return TRUE for your system will require
138 * add a DMI entry, or a boot-time "acpi_osi=Linux" invocation. 127 * a kernel source update to add a DMI entry,
128 * or boot with "acpi_osi=Linux"
139 */ 129 */
140#define OSI_LINUX_ENABLE 0
141 130
142static struct osi_linux { 131static struct osi_linux {
143 unsigned int enable:1; 132 unsigned int enable:1;
144 unsigned int dmi:1; 133 unsigned int dmi:1;
145 unsigned int cmdline:1; 134 unsigned int cmdline:1;
146 unsigned int known:1; 135 unsigned int known:1;
147} osi_linux = { OSI_LINUX_ENABLE, 0, 0, 0}; 136} osi_linux = { 0, 0, 0, 0};
148 137
149static void __init acpi_request_region (struct acpi_generic_address *addr, 138static void __init acpi_request_region (struct acpi_generic_address *addr,
150 unsigned int length, char *desc) 139 unsigned int length, char *desc)
@@ -1296,34 +1285,6 @@ acpi_status acpi_os_release_object(acpi_cache_t * cache, void *object)
1296 return (AE_OK); 1285 return (AE_OK);
1297} 1286}
1298 1287
1299/**
1300 * acpi_dmi_dump - dump DMI slots needed for blacklist entry
1301 *
1302 * Returns 0 on success
1303 */
1304static int acpi_dmi_dump(void)
1305{
1306
1307 if (!dmi_available)
1308 return -1;
1309
1310 printk(KERN_NOTICE PREFIX "DMI System Vendor: %s\n",
1311 dmi_get_system_info(DMI_SYS_VENDOR));
1312 printk(KERN_NOTICE PREFIX "DMI Product Name: %s\n",
1313 dmi_get_system_info(DMI_PRODUCT_NAME));
1314 printk(KERN_NOTICE PREFIX "DMI Product Version: %s\n",
1315 dmi_get_system_info(DMI_PRODUCT_VERSION));
1316 printk(KERN_NOTICE PREFIX "DMI Board Name: %s\n",
1317 dmi_get_system_info(DMI_BOARD_NAME));
1318 printk(KERN_NOTICE PREFIX "DMI BIOS Vendor: %s\n",
1319 dmi_get_system_info(DMI_BIOS_VENDOR));
1320 printk(KERN_NOTICE PREFIX "DMI BIOS Date: %s\n",
1321 dmi_get_system_info(DMI_BIOS_DATE));
1322
1323 return 0;
1324}
1325
1326
1327/****************************************************************************** 1288/******************************************************************************
1328 * 1289 *
1329 * FUNCTION: acpi_os_validate_interface 1290 * FUNCTION: acpi_os_validate_interface
@@ -1350,21 +1311,6 @@ acpi_os_validate_interface (char *interface)
1350 osi_linux.cmdline ? " via cmdline" : 1311 osi_linux.cmdline ? " via cmdline" :
1351 osi_linux.dmi ? " via DMI" : ""); 1312 osi_linux.dmi ? " via DMI" : "");
1352 1313
1353 if (!osi_linux.dmi) {
1354 if (acpi_dmi_dump())
1355 printk(KERN_NOTICE PREFIX
1356 "[please extract dmidecode output]\n");
1357 printk(KERN_NOTICE PREFIX
1358 "Please send DMI info above to "
1359 "linux-acpi@vger.kernel.org\n");
1360 }
1361 if (!osi_linux.known && !osi_linux.cmdline) {
1362 printk(KERN_NOTICE PREFIX
1363 "If \"acpi_osi=%sLinux\" works better, "
1364 "please notify linux-acpi@vger.kernel.org\n",
1365 osi_linux.enable ? "!" : "");
1366 }
1367
1368 if (osi_linux.enable) 1314 if (osi_linux.enable)
1369 return AE_OK; 1315 return AE_OK;
1370 } 1316 }
diff --git a/drivers/acpi/pci_irq.c b/drivers/acpi/pci_irq.c
index 11acaee14d66..bf79d83bdfbb 100644
--- a/drivers/acpi/pci_irq.c
+++ b/drivers/acpi/pci_irq.c
@@ -384,6 +384,27 @@ acpi_pci_free_irq(struct acpi_prt_entry *entry,
384 return irq; 384 return irq;
385} 385}
386 386
387#ifdef CONFIG_X86_IO_APIC
388extern int noioapicquirk;
389
390static int bridge_has_boot_interrupt_variant(struct pci_bus *bus)
391{
392 struct pci_bus *bus_it;
393
394 for (bus_it = bus ; bus_it ; bus_it = bus_it->parent) {
395 if (!bus_it->self)
396 return 0;
397
398 printk(KERN_INFO "vendor=%04x device=%04x\n", bus_it->self->vendor,
399 bus_it->self->device);
400
401 if (bus_it->self->irq_reroute_variant)
402 return bus_it->self->irq_reroute_variant;
403 }
404 return 0;
405}
406#endif /* CONFIG_X86_IO_APIC */
407
387/* 408/*
388 * acpi_pci_irq_lookup 409 * acpi_pci_irq_lookup
389 * success: return IRQ >= 0 410 * success: return IRQ >= 0
@@ -413,6 +434,41 @@ acpi_pci_irq_lookup(struct pci_bus *bus,
413 } 434 }
414 435
415 ret = func(entry, triggering, polarity, link); 436 ret = func(entry, triggering, polarity, link);
437
438#ifdef CONFIG_X86_IO_APIC
439 /*
440 * Some chipsets (e.g. intel 6700PXH) generate a legacy INTx when the
441 * IRQ entry in the chipset's IO-APIC is masked (as, e.g. the RT kernel
442 * does during interrupt handling). When this INTx generation cannot be
443 * disabled, we reroute these interrupts to their legacy equivalent to
444 * get rid of spurious interrupts.
445 */
446 if (!noioapicquirk) {
447 switch (bridge_has_boot_interrupt_variant(bus)) {
448 case 0:
449 /* no rerouting necessary */
450 break;
451
452 case INTEL_IRQ_REROUTE_VARIANT:
453 /*
454 * Remap according to INTx routing table in 6700PXH
455 * specs, intel order number 302628-002, section
456 * 2.15.2. Other chipsets (80332, ...) have the same
457 * mapping and are handled here as well.
458 */
459 printk(KERN_INFO "pci irq %d -> rerouted to legacy "
460 "irq %d\n", ret, (ret % 4) + 16);
461 ret = (ret % 4) + 16;
462 break;
463
464 default:
465 printk(KERN_INFO "not rerouting irq %d to legacy irq: "
466 "unknown mapping\n", ret);
467 break;
468 }
469 }
470#endif /* CONFIG_X86_IO_APIC */
471
416 return ret; 472 return ret;
417} 473}
418 474
diff --git a/drivers/acpi/pci_link.c b/drivers/acpi/pci_link.c
index fcfdef7b4fdd..e52ad91ce2dc 100644
--- a/drivers/acpi/pci_link.c
+++ b/drivers/acpi/pci_link.c
@@ -531,7 +531,7 @@ int __init acpi_irq_penalty_init(void)
531 return 0; 531 return 0;
532} 532}
533 533
534static int acpi_irq_balance; /* 0: static, 1: balance */ 534static int acpi_irq_balance = -1; /* 0: static, 1: balance */
535 535
536static int acpi_pci_link_allocate(struct acpi_pci_link *link) 536static int acpi_pci_link_allocate(struct acpi_pci_link *link)
537{ 537{
@@ -950,10 +950,17 @@ device_initcall(irqrouter_init_sysfs);
950 950
951static int __init acpi_pci_link_init(void) 951static int __init acpi_pci_link_init(void)
952{ 952{
953
954 if (acpi_noirq) 953 if (acpi_noirq)
955 return 0; 954 return 0;
956 955
956 if (acpi_irq_balance == -1) {
957 /* no command line switch: enable balancing in IOAPIC mode */
958 if (acpi_irq_model == ACPI_IRQ_MODEL_IOAPIC)
959 acpi_irq_balance = 1;
960 else
961 acpi_irq_balance = 0;
962 }
963
957 acpi_link.count = 0; 964 acpi_link.count = 0;
958 INIT_LIST_HEAD(&acpi_link.entries); 965 INIT_LIST_HEAD(&acpi_link.entries);
959 966
diff --git a/drivers/acpi/pci_root.c b/drivers/acpi/pci_root.c
index 1b8f67d21d53..642554b1b60c 100644
--- a/drivers/acpi/pci_root.c
+++ b/drivers/acpi/pci_root.c
@@ -376,15 +376,9 @@ static int acpi_pci_root_remove(struct acpi_device *device, int type)
376 376
377static int __init acpi_pci_root_init(void) 377static int __init acpi_pci_root_init(void)
378{ 378{
379
380 if (acpi_pci_disabled) 379 if (acpi_pci_disabled)
381 return 0; 380 return 0;
382 381
383 /* DEBUG:
384 acpi_dbg_layer = ACPI_PCI_COMPONENT;
385 acpi_dbg_level = 0xFFFFFFFF;
386 */
387
388 if (acpi_bus_register_driver(&acpi_pci_root_driver) < 0) 382 if (acpi_bus_register_driver(&acpi_pci_root_driver) < 0)
389 return -ENODEV; 383 return -ENODEV;
390 384
diff --git a/drivers/acpi/power.c b/drivers/acpi/power.c
index a1718e56103b..bb7d50dd2818 100644
--- a/drivers/acpi/power.c
+++ b/drivers/acpi/power.c
@@ -44,9 +44,8 @@
44#include <acpi/acpi_bus.h> 44#include <acpi/acpi_bus.h>
45#include <acpi/acpi_drivers.h> 45#include <acpi/acpi_drivers.h>
46 46
47#define _COMPONENT ACPI_POWER_COMPONENT 47#define _COMPONENT ACPI_POWER_COMPONENT
48ACPI_MODULE_NAME("power"); 48ACPI_MODULE_NAME("power");
49#define ACPI_POWER_COMPONENT 0x00800000
50#define ACPI_POWER_CLASS "power_resource" 49#define ACPI_POWER_CLASS "power_resource"
51#define ACPI_POWER_DEVICE_NAME "Power Resource" 50#define ACPI_POWER_DEVICE_NAME "Power Resource"
52#define ACPI_POWER_FILE_INFO "info" 51#define ACPI_POWER_FILE_INFO "info"
@@ -153,7 +152,8 @@ static int acpi_power_get_state(acpi_handle handle, int *state)
153 ACPI_POWER_RESOURCE_STATE_OFF; 152 ACPI_POWER_RESOURCE_STATE_OFF;
154 153
155 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Resource [%s] is %s\n", 154 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Resource [%s] is %s\n",
156 acpi_ut_get_node_name(handle), state ? "on" : "off")); 155 acpi_ut_get_node_name(handle),
156 *state ? "on" : "off"));
157 157
158 return 0; 158 return 0;
159} 159}
@@ -516,11 +516,6 @@ int acpi_power_transition(struct acpi_device *device, int state)
516 cl = &device->power.states[device->power.state].resources; 516 cl = &device->power.states[device->power.state].resources;
517 tl = &device->power.states[state].resources; 517 tl = &device->power.states[state].resources;
518 518
519 if (!cl->count && !tl->count) {
520 result = -ENODEV;
521 goto end;
522 }
523
524 /* TBD: Resources must be ordered. */ 519 /* TBD: Resources must be ordered. */
525 520
526 /* 521 /*
diff --git a/drivers/acpi/processor_core.c b/drivers/acpi/processor_core.c
index 24a362f8034c..34948362f41d 100644
--- a/drivers/acpi/processor_core.c
+++ b/drivers/acpi/processor_core.c
@@ -59,7 +59,6 @@
59#include <acpi/acpi_drivers.h> 59#include <acpi/acpi_drivers.h>
60#include <acpi/processor.h> 60#include <acpi/processor.h>
61 61
62#define ACPI_PROCESSOR_COMPONENT 0x01000000
63#define ACPI_PROCESSOR_CLASS "processor" 62#define ACPI_PROCESSOR_CLASS "processor"
64#define ACPI_PROCESSOR_DEVICE_NAME "Processor" 63#define ACPI_PROCESSOR_DEVICE_NAME "Processor"
65#define ACPI_PROCESSOR_FILE_INFO "info" 64#define ACPI_PROCESSOR_FILE_INFO "info"
@@ -89,6 +88,7 @@ static int acpi_processor_handle_eject(struct acpi_processor *pr);
89 88
90 89
91static const struct acpi_device_id processor_device_ids[] = { 90static const struct acpi_device_id processor_device_ids[] = {
91 {ACPI_PROCESSOR_OBJECT_HID, 0},
92 {ACPI_PROCESSOR_HID, 0}, 92 {ACPI_PROCESSOR_HID, 0},
93 {"", 0}, 93 {"", 0},
94}; 94};
@@ -409,7 +409,7 @@ static int acpi_processor_remove_fs(struct acpi_device *device)
409/* Use the acpiid in MADT to map cpus in case of SMP */ 409/* Use the acpiid in MADT to map cpus in case of SMP */
410 410
411#ifndef CONFIG_SMP 411#ifndef CONFIG_SMP
412static int get_cpu_id(acpi_handle handle, u32 acpi_id) {return -1;} 412static int get_cpu_id(acpi_handle handle, int type, u32 acpi_id) { return -1; }
413#else 413#else
414 414
415static struct acpi_table_madt *madt; 415static struct acpi_table_madt *madt;
@@ -428,27 +428,35 @@ static int map_lapic_id(struct acpi_subtable_header *entry,
428} 428}
429 429
430static int map_lsapic_id(struct acpi_subtable_header *entry, 430static int map_lsapic_id(struct acpi_subtable_header *entry,
431 u32 acpi_id, int *apic_id) 431 int device_declaration, u32 acpi_id, int *apic_id)
432{ 432{
433 struct acpi_madt_local_sapic *lsapic = 433 struct acpi_madt_local_sapic *lsapic =
434 (struct acpi_madt_local_sapic *)entry; 434 (struct acpi_madt_local_sapic *)entry;
435 u32 tmp = (lsapic->id << 8) | lsapic->eid;
436
435 /* Only check enabled APICs*/ 437 /* Only check enabled APICs*/
436 if (lsapic->lapic_flags & ACPI_MADT_ENABLED) { 438 if (!(lsapic->lapic_flags & ACPI_MADT_ENABLED))
437 /* First check against id */ 439 return 0;
438 if (lsapic->processor_id == acpi_id) { 440
439 *apic_id = (lsapic->id << 8) | lsapic->eid; 441 /* Device statement declaration type */
440 return 1; 442 if (device_declaration) {
441 /* Check against optional uid */ 443 if (entry->length < 16)
442 } else if (entry->length >= 16 && 444 printk(KERN_ERR PREFIX
443 lsapic->uid == acpi_id) { 445 "Invalid LSAPIC with Device type processor (SAPIC ID %#x)\n",
444 *apic_id = lsapic->uid; 446 tmp);
445 return 1; 447 else if (lsapic->uid == acpi_id)
446 } 448 goto found;
447 } 449 /* Processor statement declaration type */
450 } else if (lsapic->processor_id == acpi_id)
451 goto found;
452
448 return 0; 453 return 0;
454found:
455 *apic_id = tmp;
456 return 1;
449} 457}
450 458
451static int map_madt_entry(u32 acpi_id) 459static int map_madt_entry(int type, u32 acpi_id)
452{ 460{
453 unsigned long madt_end, entry; 461 unsigned long madt_end, entry;
454 int apic_id = -1; 462 int apic_id = -1;
@@ -469,7 +477,7 @@ static int map_madt_entry(u32 acpi_id)
469 if (map_lapic_id(header, acpi_id, &apic_id)) 477 if (map_lapic_id(header, acpi_id, &apic_id))
470 break; 478 break;
471 } else if (header->type == ACPI_MADT_TYPE_LOCAL_SAPIC) { 479 } else if (header->type == ACPI_MADT_TYPE_LOCAL_SAPIC) {
472 if (map_lsapic_id(header, acpi_id, &apic_id)) 480 if (map_lsapic_id(header, type, acpi_id, &apic_id))
473 break; 481 break;
474 } 482 }
475 entry += header->length; 483 entry += header->length;
@@ -477,7 +485,7 @@ static int map_madt_entry(u32 acpi_id)
477 return apic_id; 485 return apic_id;
478} 486}
479 487
480static int map_mat_entry(acpi_handle handle, u32 acpi_id) 488static int map_mat_entry(acpi_handle handle, int type, u32 acpi_id)
481{ 489{
482 struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; 490 struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
483 union acpi_object *obj; 491 union acpi_object *obj;
@@ -500,7 +508,7 @@ static int map_mat_entry(acpi_handle handle, u32 acpi_id)
500 if (header->type == ACPI_MADT_TYPE_LOCAL_APIC) { 508 if (header->type == ACPI_MADT_TYPE_LOCAL_APIC) {
501 map_lapic_id(header, acpi_id, &apic_id); 509 map_lapic_id(header, acpi_id, &apic_id);
502 } else if (header->type == ACPI_MADT_TYPE_LOCAL_SAPIC) { 510 } else if (header->type == ACPI_MADT_TYPE_LOCAL_SAPIC) {
503 map_lsapic_id(header, acpi_id, &apic_id); 511 map_lsapic_id(header, type, acpi_id, &apic_id);
504 } 512 }
505 513
506exit: 514exit:
@@ -509,14 +517,14 @@ exit:
509 return apic_id; 517 return apic_id;
510} 518}
511 519
512static int get_cpu_id(acpi_handle handle, u32 acpi_id) 520static int get_cpu_id(acpi_handle handle, int type, u32 acpi_id)
513{ 521{
514 int i; 522 int i;
515 int apic_id = -1; 523 int apic_id = -1;
516 524
517 apic_id = map_mat_entry(handle, acpi_id); 525 apic_id = map_mat_entry(handle, type, acpi_id);
518 if (apic_id == -1) 526 if (apic_id == -1)
519 apic_id = map_madt_entry(acpi_id); 527 apic_id = map_madt_entry(type, acpi_id);
520 if (apic_id == -1) 528 if (apic_id == -1)
521 return apic_id; 529 return apic_id;
522 530
@@ -532,15 +540,16 @@ static int get_cpu_id(acpi_handle handle, u32 acpi_id)
532 Driver Interface 540 Driver Interface
533 -------------------------------------------------------------------------- */ 541 -------------------------------------------------------------------------- */
534 542
535static int acpi_processor_get_info(struct acpi_processor *pr, unsigned has_uid) 543static int acpi_processor_get_info(struct acpi_device *device)
536{ 544{
537 acpi_status status = 0; 545 acpi_status status = 0;
538 union acpi_object object = { 0 }; 546 union acpi_object object = { 0 };
539 struct acpi_buffer buffer = { sizeof(union acpi_object), &object }; 547 struct acpi_buffer buffer = { sizeof(union acpi_object), &object };
540 int cpu_index; 548 struct acpi_processor *pr;
549 int cpu_index, device_declaration = 0;
541 static int cpu0_initialized; 550 static int cpu0_initialized;
542 551
543 552 pr = acpi_driver_data(device);
544 if (!pr) 553 if (!pr)
545 return -EINVAL; 554 return -EINVAL;
546 555
@@ -561,22 +570,23 @@ static int acpi_processor_get_info(struct acpi_processor *pr, unsigned has_uid)
561 ACPI_DEBUG_PRINT((ACPI_DB_INFO, 570 ACPI_DEBUG_PRINT((ACPI_DB_INFO,
562 "No bus mastering arbitration control\n")); 571 "No bus mastering arbitration control\n"));
563 572
564 /* Check if it is a Device with HID and UID */ 573 if (!strcmp(acpi_device_hid(device), ACPI_PROCESSOR_HID)) {
565 if (has_uid) { 574 /*
575 * Declared with "Device" statement; match _UID.
576 * Note that we don't handle string _UIDs yet.
577 */
566 unsigned long long value; 578 unsigned long long value;
567 status = acpi_evaluate_integer(pr->handle, METHOD_NAME__UID, 579 status = acpi_evaluate_integer(pr->handle, METHOD_NAME__UID,
568 NULL, &value); 580 NULL, &value);
569 if (ACPI_FAILURE(status)) { 581 if (ACPI_FAILURE(status)) {
570 printk(KERN_ERR PREFIX "Evaluating processor _UID\n"); 582 printk(KERN_ERR PREFIX
583 "Evaluating processor _UID [%#x]\n", status);
571 return -ENODEV; 584 return -ENODEV;
572 } 585 }
586 device_declaration = 1;
573 pr->acpi_id = value; 587 pr->acpi_id = value;
574 } else { 588 } else {
575 /* 589 /* Declared with "Processor" statement; match ProcessorID */
576 * Evalute the processor object. Note that it is common on SMP to
577 * have the first (boot) processor with a valid PBLK address while
578 * all others have a NULL address.
579 */
580 status = acpi_evaluate_object(pr->handle, NULL, NULL, &buffer); 590 status = acpi_evaluate_object(pr->handle, NULL, NULL, &buffer);
581 if (ACPI_FAILURE(status)) { 591 if (ACPI_FAILURE(status)) {
582 printk(KERN_ERR PREFIX "Evaluating processor object\n"); 592 printk(KERN_ERR PREFIX "Evaluating processor object\n");
@@ -584,12 +594,13 @@ static int acpi_processor_get_info(struct acpi_processor *pr, unsigned has_uid)
584 } 594 }
585 595
586 /* 596 /*
587 * TBD: Synch processor ID (via LAPIC/LSAPIC structures) on SMP. 597 * TBD: Synch processor ID (via LAPIC/LSAPIC structures) on SMP.
588 * >>> 'acpi_get_processor_id(acpi_id, &id)' in arch/xxx/acpi.c 598 * >>> 'acpi_get_processor_id(acpi_id, &id)' in
589 */ 599 * arch/xxx/acpi.c
600 */
590 pr->acpi_id = object.processor.proc_id; 601 pr->acpi_id = object.processor.proc_id;
591 } 602 }
592 cpu_index = get_cpu_id(pr->handle, pr->acpi_id); 603 cpu_index = get_cpu_id(pr->handle, device_declaration, pr->acpi_id);
593 604
594 /* Handle UP system running SMP kernel, with no LAPIC in MADT */ 605 /* Handle UP system running SMP kernel, with no LAPIC in MADT */
595 if (!cpu0_initialized && (cpu_index == -1) && 606 if (!cpu0_initialized && (cpu_index == -1) &&
@@ -661,7 +672,7 @@ static int __cpuinit acpi_processor_start(struct acpi_device *device)
661 672
662 pr = acpi_driver_data(device); 673 pr = acpi_driver_data(device);
663 674
664 result = acpi_processor_get_info(pr, device->flags.unique_id); 675 result = acpi_processor_get_info(device);
665 if (result) { 676 if (result) {
666 /* Processor is physically not present */ 677 /* Processor is physically not present */
667 return 0; 678 return 0;
@@ -761,20 +772,20 @@ static void acpi_processor_notify(acpi_handle handle, u32 event, void *data)
761 acpi_bus_generate_proc_event(device, event, 772 acpi_bus_generate_proc_event(device, event,
762 pr->performance_platform_limit); 773 pr->performance_platform_limit);
763 acpi_bus_generate_netlink_event(device->pnp.device_class, 774 acpi_bus_generate_netlink_event(device->pnp.device_class,
764 device->dev.bus_id, event, 775 dev_name(&device->dev), event,
765 pr->performance_platform_limit); 776 pr->performance_platform_limit);
766 break; 777 break;
767 case ACPI_PROCESSOR_NOTIFY_POWER: 778 case ACPI_PROCESSOR_NOTIFY_POWER:
768 acpi_processor_cst_has_changed(pr); 779 acpi_processor_cst_has_changed(pr);
769 acpi_bus_generate_proc_event(device, event, 0); 780 acpi_bus_generate_proc_event(device, event, 0);
770 acpi_bus_generate_netlink_event(device->pnp.device_class, 781 acpi_bus_generate_netlink_event(device->pnp.device_class,
771 device->dev.bus_id, event, 0); 782 dev_name(&device->dev), event, 0);
772 break; 783 break;
773 case ACPI_PROCESSOR_NOTIFY_THROTTLING: 784 case ACPI_PROCESSOR_NOTIFY_THROTTLING:
774 acpi_processor_tstate_has_changed(pr); 785 acpi_processor_tstate_has_changed(pr);
775 acpi_bus_generate_proc_event(device, event, 0); 786 acpi_bus_generate_proc_event(device, event, 0);
776 acpi_bus_generate_netlink_event(device->pnp.device_class, 787 acpi_bus_generate_netlink_event(device->pnp.device_class,
777 device->dev.bus_id, event, 0); 788 dev_name(&device->dev), event, 0);
778 default: 789 default:
779 ACPI_DEBUG_PRINT((ACPI_DB_INFO, 790 ACPI_DEBUG_PRINT((ACPI_DB_INFO,
780 "Unsupported event [0x%x]\n", event)); 791 "Unsupported event [0x%x]\n", event));
diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c
index 81b40ed5379e..5f8d746a9b81 100644
--- a/drivers/acpi/processor_idle.c
+++ b/drivers/acpi/processor_idle.c
@@ -59,7 +59,6 @@
59#include <acpi/processor.h> 59#include <acpi/processor.h>
60#include <asm/processor.h> 60#include <asm/processor.h>
61 61
62#define ACPI_PROCESSOR_COMPONENT 0x01000000
63#define ACPI_PROCESSOR_CLASS "processor" 62#define ACPI_PROCESSOR_CLASS "processor"
64#define _COMPONENT ACPI_PROCESSOR_COMPONENT 63#define _COMPONENT ACPI_PROCESSOR_COMPONENT
65ACPI_MODULE_NAME("processor_idle"); 64ACPI_MODULE_NAME("processor_idle");
diff --git a/drivers/acpi/processor_perflib.c b/drivers/acpi/processor_perflib.c
index dbcf260ea93f..0d7b772bef50 100644
--- a/drivers/acpi/processor_perflib.c
+++ b/drivers/acpi/processor_perflib.c
@@ -44,9 +44,9 @@
44#endif 44#endif
45 45
46#include <acpi/acpi_bus.h> 46#include <acpi/acpi_bus.h>
47#include <acpi/acpi_drivers.h>
47#include <acpi/processor.h> 48#include <acpi/processor.h>
48 49
49#define ACPI_PROCESSOR_COMPONENT 0x01000000
50#define ACPI_PROCESSOR_CLASS "processor" 50#define ACPI_PROCESSOR_CLASS "processor"
51#define ACPI_PROCESSOR_FILE_PERFORMANCE "performance" 51#define ACPI_PROCESSOR_FILE_PERFORMANCE "performance"
52#define _COMPONENT ACPI_PROCESSOR_COMPONENT 52#define _COMPONENT ACPI_PROCESSOR_COMPONENT
diff --git a/drivers/acpi/processor_thermal.c b/drivers/acpi/processor_thermal.c
index ef34b18f95ca..b1eb376fae45 100644
--- a/drivers/acpi/processor_thermal.c
+++ b/drivers/acpi/processor_thermal.c
@@ -40,7 +40,6 @@
40#include <acpi/processor.h> 40#include <acpi/processor.h>
41#include <acpi/acpi_drivers.h> 41#include <acpi/acpi_drivers.h>
42 42
43#define ACPI_PROCESSOR_COMPONENT 0x01000000
44#define ACPI_PROCESSOR_CLASS "processor" 43#define ACPI_PROCESSOR_CLASS "processor"
45#define _COMPONENT ACPI_PROCESSOR_COMPONENT 44#define _COMPONENT ACPI_PROCESSOR_COMPONENT
46ACPI_MODULE_NAME("processor_thermal"); 45ACPI_MODULE_NAME("processor_thermal");
diff --git a/drivers/acpi/processor_throttling.c b/drivers/acpi/processor_throttling.c
index 3da2df93d924..a0c38c94a8a0 100644
--- a/drivers/acpi/processor_throttling.c
+++ b/drivers/acpi/processor_throttling.c
@@ -38,9 +38,9 @@
38#include <asm/uaccess.h> 38#include <asm/uaccess.h>
39 39
40#include <acpi/acpi_bus.h> 40#include <acpi/acpi_bus.h>
41#include <acpi/acpi_drivers.h>
41#include <acpi/processor.h> 42#include <acpi/processor.h>
42 43
43#define ACPI_PROCESSOR_COMPONENT 0x01000000
44#define ACPI_PROCESSOR_CLASS "processor" 44#define ACPI_PROCESSOR_CLASS "processor"
45#define _COMPONENT ACPI_PROCESSOR_COMPONENT 45#define _COMPONENT ACPI_PROCESSOR_COMPONENT
46ACPI_MODULE_NAME("processor_throttling"); 46ACPI_MODULE_NAME("processor_throttling");
diff --git a/drivers/acpi/reboot.c b/drivers/acpi/reboot.c
index 755baf2ca70a..a6b662c00b67 100644
--- a/drivers/acpi/reboot.c
+++ b/drivers/acpi/reboot.c
@@ -15,28 +15,9 @@ void acpi_reboot(void)
15 15
16 rr = &acpi_gbl_FADT.reset_register; 16 rr = &acpi_gbl_FADT.reset_register;
17 17
18 /* 18 /* Is the reset register supported? */
19 * Is the ACPI reset register supported? 19 if (!(acpi_gbl_FADT.flags & ACPI_FADT_RESET_REGISTER) ||
20 * 20 rr->bit_width != 8 || rr->bit_offset != 0)
21 * According to ACPI 3.0, FADT.flags.RESET_REG_SUP indicates
22 * whether the ACPI reset mechanism is supported.
23 *
24 * However, some boxes have this bit clear, yet a valid
25 * ACPI_RESET_REG & RESET_VALUE, and ACPI reboot is the only
26 * mechanism that works for them after S3.
27 *
28 * This suggests that other operating systems may not be checking
29 * the RESET_REG_SUP bit, and are using other means to decide
30 * whether to use the ACPI reboot mechanism or not.
31 *
32 * So when acpi reboot is requested,
33 * only the reset_register is checked. If the following
34 * conditions are met, it indicates that the reset register is supported.
35 * a. reset_register is not zero
36 * b. the access width is eight
37 * c. the bit_offset is zero
38 */
39 if (!(rr->address) || rr->bit_width != 8 || rr->bit_offset != 0)
40 return; 21 return;
41 22
42 reset_value = acpi_gbl_FADT.reset_value; 23 reset_value = acpi_gbl_FADT.reset_value;
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
index a9dda8e0f9f9..39b7233c3485 100644
--- a/drivers/acpi/scan.c
+++ b/drivers/acpi/scan.c
@@ -109,8 +109,7 @@ static int acpi_bus_hot_remove_device(void *context)
109 return 0; 109 return 0;
110 110
111 ACPI_DEBUG_PRINT((ACPI_DB_INFO, 111 ACPI_DEBUG_PRINT((ACPI_DB_INFO,
112 "Hot-removing device %s...\n", device->dev.bus_id)); 112 "Hot-removing device %s...\n", dev_name(&device->dev)));
113
114 113
115 if (acpi_bus_trim(device, 1)) { 114 if (acpi_bus_trim(device, 1)) {
116 printk(KERN_ERR PREFIX 115 printk(KERN_ERR PREFIX
@@ -460,7 +459,7 @@ static int acpi_device_register(struct acpi_device *device,
460 acpi_device_bus_id->instance_no = 0; 459 acpi_device_bus_id->instance_no = 0;
461 list_add_tail(&acpi_device_bus_id->node, &acpi_bus_id_list); 460 list_add_tail(&acpi_device_bus_id->node, &acpi_bus_id_list);
462 } 461 }
463 sprintf(device->dev.bus_id, "%s:%02x", acpi_device_bus_id->bus_id, acpi_device_bus_id->instance_no); 462 dev_set_name(&device->dev, "%s:%02x", acpi_device_bus_id->bus_id, acpi_device_bus_id->instance_no);
464 463
465 if (device->parent) { 464 if (device->parent) {
466 list_add_tail(&device->node, &device->parent->children); 465 list_add_tail(&device->node, &device->parent->children);
@@ -484,7 +483,8 @@ static int acpi_device_register(struct acpi_device *device,
484 483
485 result = acpi_device_setup_files(device); 484 result = acpi_device_setup_files(device);
486 if(result) 485 if(result)
487 printk(KERN_ERR PREFIX "Error creating sysfs interface for device %s\n", device->dev.bus_id); 486 printk(KERN_ERR PREFIX "Error creating sysfs interface for device %s\n",
487 dev_name(&device->dev));
488 488
489 device->removal_type = ACPI_BUS_REMOVAL_NORMAL; 489 device->removal_type = ACPI_BUS_REMOVAL_NORMAL;
490 return 0; 490 return 0;
@@ -751,16 +751,6 @@ static int acpi_bus_get_wakeup_device_flags(struct acpi_device *device)
751 if (!acpi_match_device_ids(device, button_device_ids)) 751 if (!acpi_match_device_ids(device, button_device_ids))
752 device->wakeup.flags.run_wake = 1; 752 device->wakeup.flags.run_wake = 1;
753 753
754 /*
755 * Don't set Power button GPE as run_wake
756 * if Fixed Power button is used
757 */
758 if (!strcmp(device->pnp.hardware_id, "PNP0C0C") &&
759 !(acpi_gbl_FADT.flags & ACPI_FADT_POWER_BUTTON)) {
760 device->wakeup.flags.run_wake = 0;
761 device->wakeup.flags.valid = 0;
762 }
763
764 end: 754 end:
765 if (ACPI_FAILURE(status)) 755 if (ACPI_FAILURE(status))
766 device->flags.wake_capable = 0; 756 device->flags.wake_capable = 0;
@@ -919,36 +909,6 @@ static void acpi_device_get_busid(struct acpi_device *device,
919 } 909 }
920} 910}
921 911
922static int
923acpi_video_bus_match(struct acpi_device *device)
924{
925 acpi_handle h_dummy;
926
927 if (!device)
928 return -EINVAL;
929
930 /* Since there is no HID, CID for ACPI Video drivers, we have
931 * to check well known required nodes for each feature we support.
932 */
933
934 /* Does this device able to support video switching ? */
935 if (ACPI_SUCCESS(acpi_get_handle(device->handle, "_DOD", &h_dummy)) &&
936 ACPI_SUCCESS(acpi_get_handle(device->handle, "_DOS", &h_dummy)))
937 return 0;
938
939 /* Does this device able to retrieve a video ROM ? */
940 if (ACPI_SUCCESS(acpi_get_handle(device->handle, "_ROM", &h_dummy)))
941 return 0;
942
943 /* Does this device able to configure which video head to be POSTed ? */
944 if (ACPI_SUCCESS(acpi_get_handle(device->handle, "_VPO", &h_dummy)) &&
945 ACPI_SUCCESS(acpi_get_handle(device->handle, "_GPD", &h_dummy)) &&
946 ACPI_SUCCESS(acpi_get_handle(device->handle, "_SPD", &h_dummy)))
947 return 0;
948
949 return -ENODEV;
950}
951
952/* 912/*
953 * acpi_bay_match - see if a device is an ejectable driver bay 913 * acpi_bay_match - see if a device is an ejectable driver bay
954 * 914 *
@@ -1031,7 +991,7 @@ static void acpi_device_set_id(struct acpi_device *device,
1031 will get autoloaded and the device might still match 991 will get autoloaded and the device might still match
1032 against another driver. 992 against another driver.
1033 */ 993 */
1034 if (ACPI_SUCCESS(acpi_video_bus_match(device))) 994 if (acpi_is_video_device(device))
1035 cid_add = ACPI_VIDEO_HID; 995 cid_add = ACPI_VIDEO_HID;
1036 else if (ACPI_SUCCESS(acpi_bay_match(device))) 996 else if (ACPI_SUCCESS(acpi_bay_match(device)))
1037 cid_add = ACPI_BAY_HID; 997 cid_add = ACPI_BAY_HID;
@@ -1043,7 +1003,7 @@ static void acpi_device_set_id(struct acpi_device *device,
1043 hid = ACPI_POWER_HID; 1003 hid = ACPI_POWER_HID;
1044 break; 1004 break;
1045 case ACPI_BUS_TYPE_PROCESSOR: 1005 case ACPI_BUS_TYPE_PROCESSOR:
1046 hid = ACPI_PROCESSOR_HID; 1006 hid = ACPI_PROCESSOR_OBJECT_HID;
1047 break; 1007 break;
1048 case ACPI_BUS_TYPE_SYSTEM: 1008 case ACPI_BUS_TYPE_SYSTEM:
1049 hid = ACPI_SYSTEM_HID; 1009 hid = ACPI_SYSTEM_HID;
diff --git a/drivers/acpi/sleep/main.c b/drivers/acpi/sleep/main.c
index 80c0868d0480..28a691cc625e 100644
--- a/drivers/acpi/sleep/main.c
+++ b/drivers/acpi/sleep/main.c
@@ -90,6 +90,18 @@ void __init acpi_old_suspend_ordering(void)
90 old_suspend_ordering = true; 90 old_suspend_ordering = true;
91} 91}
92 92
93/*
94 * According to the ACPI specification the BIOS should make sure that ACPI is
95 * enabled and SCI_EN bit is set on wake-up from S1 - S3 sleep states. Still,
96 * some BIOSes don't do that and therefore we use acpi_enable() to enable ACPI
97 * on such systems during resume. Unfortunately that doesn't help in
98 * particularly pathological cases in which SCI_EN has to be set directly on
99 * resume, although the specification states very clearly that this flag is
100 * owned by the hardware. The set_sci_en_on_resume variable will be set in such
101 * cases.
102 */
103static bool set_sci_en_on_resume;
104
93/** 105/**
94 * acpi_pm_disable_gpes - Disable the GPEs. 106 * acpi_pm_disable_gpes - Disable the GPEs.
95 */ 107 */
@@ -235,7 +247,11 @@ static int acpi_suspend_enter(suspend_state_t pm_state)
235 } 247 }
236 248
237 /* If ACPI is not enabled by the BIOS, we need to enable it here. */ 249 /* If ACPI is not enabled by the BIOS, we need to enable it here. */
238 acpi_enable(); 250 if (set_sci_en_on_resume)
251 acpi_set_register(ACPI_BITREG_SCI_ENABLE, 1);
252 else
253 acpi_enable();
254
239 /* Reprogram control registers and execute _BFS */ 255 /* Reprogram control registers and execute _BFS */
240 acpi_leave_sleep_state_prep(acpi_state); 256 acpi_leave_sleep_state_prep(acpi_state);
241 257
@@ -323,6 +339,12 @@ static int __init init_old_suspend_ordering(const struct dmi_system_id *d)
323 return 0; 339 return 0;
324} 340}
325 341
342static int __init init_set_sci_en_on_resume(const struct dmi_system_id *d)
343{
344 set_sci_en_on_resume = true;
345 return 0;
346}
347
326static struct dmi_system_id __initdata acpisleep_dmi_table[] = { 348static struct dmi_system_id __initdata acpisleep_dmi_table[] = {
327 { 349 {
328 .callback = init_old_suspend_ordering, 350 .callback = init_old_suspend_ordering,
@@ -340,6 +362,22 @@ static struct dmi_system_id __initdata acpisleep_dmi_table[] = {
340 DMI_MATCH(DMI_PRODUCT_NAME, "HP xw4600 Workstation"), 362 DMI_MATCH(DMI_PRODUCT_NAME, "HP xw4600 Workstation"),
341 }, 363 },
342 }, 364 },
365 {
366 .callback = init_set_sci_en_on_resume,
367 .ident = "Apple MacBook 1,1",
368 .matches = {
369 DMI_MATCH(DMI_SYS_VENDOR, "Apple Computer, Inc."),
370 DMI_MATCH(DMI_PRODUCT_NAME, "MacBook1,1"),
371 },
372 },
373 {
374 .callback = init_set_sci_en_on_resume,
375 .ident = "Apple MacMini 1,1",
376 .matches = {
377 DMI_MATCH(DMI_SYS_VENDOR, "Apple Computer, Inc."),
378 DMI_MATCH(DMI_PRODUCT_NAME, "Macmini1,1"),
379 },
380 },
343 {}, 381 {},
344}; 382};
345#endif /* CONFIG_SUSPEND */ 383#endif /* CONFIG_SUSPEND */
diff --git a/drivers/acpi/sleep/proc.c b/drivers/acpi/sleep/proc.c
index 631ee2ee2ca0..4dbc2271acf5 100644
--- a/drivers/acpi/sleep/proc.c
+++ b/drivers/acpi/sleep/proc.c
@@ -367,7 +367,7 @@ acpi_system_wakeup_device_seq_show(struct seq_file *seq, void *offset)
367 if (ldev) 367 if (ldev)
368 seq_printf(seq, "%s:%s", 368 seq_printf(seq, "%s:%s",
369 ldev->bus ? ldev->bus->name : "no-bus", 369 ldev->bus ? ldev->bus->name : "no-bus",
370 ldev->bus_id); 370 dev_name(ldev));
371 seq_printf(seq, "\n"); 371 seq_printf(seq, "\n");
372 put_device(ldev); 372 put_device(ldev);
373 373
diff --git a/drivers/acpi/sleep/wakeup.c b/drivers/acpi/sleep/wakeup.c
index 38655eb132dc..dea4c23df764 100644
--- a/drivers/acpi/sleep/wakeup.c
+++ b/drivers/acpi/sleep/wakeup.c
@@ -88,7 +88,7 @@ void acpi_enable_wakeup_device(u8 sleep_state)
88 spin_unlock(&acpi_device_lock); 88 spin_unlock(&acpi_device_lock);
89 if (!dev->wakeup.flags.run_wake) 89 if (!dev->wakeup.flags.run_wake)
90 acpi_enable_gpe(dev->wakeup.gpe_device, 90 acpi_enable_gpe(dev->wakeup.gpe_device,
91 dev->wakeup.gpe_number, ACPI_ISR); 91 dev->wakeup.gpe_number);
92 spin_lock(&acpi_device_lock); 92 spin_lock(&acpi_device_lock);
93 } 93 }
94 spin_unlock(&acpi_device_lock); 94 spin_unlock(&acpi_device_lock);
@@ -122,7 +122,7 @@ void acpi_disable_wakeup_device(u8 sleep_state)
122 ACPI_GPE_TYPE_WAKE_RUN); 122 ACPI_GPE_TYPE_WAKE_RUN);
123 /* Re-enable it, since set_gpe_type will disable it */ 123 /* Re-enable it, since set_gpe_type will disable it */
124 acpi_enable_gpe(dev->wakeup.gpe_device, 124 acpi_enable_gpe(dev->wakeup.gpe_device,
125 dev->wakeup.gpe_number, ACPI_NOT_ISR); 125 dev->wakeup.gpe_number);
126 spin_lock(&acpi_device_lock); 126 spin_lock(&acpi_device_lock);
127 } 127 }
128 continue; 128 continue;
@@ -133,7 +133,7 @@ void acpi_disable_wakeup_device(u8 sleep_state)
133 /* Never disable run-wake GPE */ 133 /* Never disable run-wake GPE */
134 if (!dev->wakeup.flags.run_wake) { 134 if (!dev->wakeup.flags.run_wake) {
135 acpi_disable_gpe(dev->wakeup.gpe_device, 135 acpi_disable_gpe(dev->wakeup.gpe_device,
136 dev->wakeup.gpe_number, ACPI_NOT_ISR); 136 dev->wakeup.gpe_number);
137 acpi_clear_gpe(dev->wakeup.gpe_device, 137 acpi_clear_gpe(dev->wakeup.gpe_device,
138 dev->wakeup.gpe_number, ACPI_NOT_ISR); 138 dev->wakeup.gpe_number, ACPI_NOT_ISR);
139 } 139 }
@@ -162,7 +162,7 @@ static int __init acpi_wakeup_device_init(void)
162 dev->wakeup.gpe_number, 162 dev->wakeup.gpe_number,
163 ACPI_GPE_TYPE_WAKE_RUN); 163 ACPI_GPE_TYPE_WAKE_RUN);
164 acpi_enable_gpe(dev->wakeup.gpe_device, 164 acpi_enable_gpe(dev->wakeup.gpe_device,
165 dev->wakeup.gpe_number, ACPI_NOT_ISR); 165 dev->wakeup.gpe_number);
166 dev->wakeup.state.enabled = 1; 166 dev->wakeup.state.enabled = 1;
167 spin_lock(&acpi_device_lock); 167 spin_lock(&acpi_device_lock);
168 } 168 }
diff --git a/drivers/acpi/system.c b/drivers/acpi/system.c
index 1d74171b7940..6e4107f82403 100644
--- a/drivers/acpi/system.c
+++ b/drivers/acpi/system.c
@@ -78,9 +78,15 @@ static ssize_t acpi_table_show(struct kobject *kobj,
78 container_of(bin_attr, struct acpi_table_attr, attr); 78 container_of(bin_attr, struct acpi_table_attr, attr);
79 struct acpi_table_header *table_header = NULL; 79 struct acpi_table_header *table_header = NULL;
80 acpi_status status; 80 acpi_status status;
81 char name[ACPI_NAME_SIZE];
82
83 if (strncmp(table_attr->name, "NULL", 4))
84 memcpy(name, table_attr->name, ACPI_NAME_SIZE);
85 else
86 memcpy(name, "\0\0\0\0", 4);
81 87
82 status = 88 status =
83 acpi_get_table(table_attr->name, table_attr->instance, 89 acpi_get_table(name, table_attr->instance,
84 &table_header); 90 &table_header);
85 if (ACPI_FAILURE(status)) 91 if (ACPI_FAILURE(status))
86 return -ENODEV; 92 return -ENODEV;
@@ -95,21 +101,24 @@ static void acpi_table_attr_init(struct acpi_table_attr *table_attr,
95 struct acpi_table_header *header = NULL; 101 struct acpi_table_header *header = NULL;
96 struct acpi_table_attr *attr = NULL; 102 struct acpi_table_attr *attr = NULL;
97 103
98 memcpy(table_attr->name, table_header->signature, ACPI_NAME_SIZE); 104 if (table_header->signature[0] != '\0')
105 memcpy(table_attr->name, table_header->signature,
106 ACPI_NAME_SIZE);
107 else
108 memcpy(table_attr->name, "NULL", 4);
99 109
100 list_for_each_entry(attr, &acpi_table_attr_list, node) { 110 list_for_each_entry(attr, &acpi_table_attr_list, node) {
101 if (!memcmp(table_header->signature, attr->name, 111 if (!memcmp(table_attr->name, attr->name, ACPI_NAME_SIZE))
102 ACPI_NAME_SIZE))
103 if (table_attr->instance < attr->instance) 112 if (table_attr->instance < attr->instance)
104 table_attr->instance = attr->instance; 113 table_attr->instance = attr->instance;
105 } 114 }
106 table_attr->instance++; 115 table_attr->instance++;
107 116
108 if (table_attr->instance > 1 || (table_attr->instance == 1 && 117 if (table_attr->instance > 1 || (table_attr->instance == 1 &&
109 !acpi_get_table(table_header-> 118 !acpi_get_table
110 signature, 2, 119 (table_header->signature, 2, &header)))
111 &header))) 120 sprintf(table_attr->name + ACPI_NAME_SIZE, "%d",
112 sprintf(table_attr->name + 4, "%d", table_attr->instance); 121 table_attr->instance);
113 122
114 table_attr->attr.size = 0; 123 table_attr->attr.size = 0;
115 table_attr->attr.read = acpi_table_show; 124 table_attr->attr.read = acpi_table_show;
@@ -167,7 +176,6 @@ static int acpi_system_sysfs_init(void)
167#define COUNT_ERROR 2 /* other */ 176#define COUNT_ERROR 2 /* other */
168#define NUM_COUNTERS_EXTRA 3 177#define NUM_COUNTERS_EXTRA 3
169 178
170#define ACPI_EVENT_VALID 0x01
171struct event_counter { 179struct event_counter {
172 u32 count; 180 u32 count;
173 u32 flags; 181 u32 flags;
@@ -312,12 +320,6 @@ static int get_status(u32 index, acpi_event_status *status, acpi_handle *handle)
312 } else if (index < (num_gpes + ACPI_NUM_FIXED_EVENTS)) 320 } else if (index < (num_gpes + ACPI_NUM_FIXED_EVENTS))
313 result = acpi_get_event_status(index - num_gpes, status); 321 result = acpi_get_event_status(index - num_gpes, status);
314 322
315 /*
316 * sleep/power button GPE/Fixed Event is enabled after acpi_system_init,
317 * check the status at runtime and mark it as valid once it's enabled
318 */
319 if (!result && (*status & ACPI_EVENT_FLAG_ENABLED))
320 all_counters[index].flags |= ACPI_EVENT_VALID;
321end: 323end:
322 return result; 324 return result;
323} 325}
@@ -346,12 +348,14 @@ static ssize_t counter_show(struct kobject *kobj,
346 if (result) 348 if (result)
347 goto end; 349 goto end;
348 350
349 if (!(all_counters[index].flags & ACPI_EVENT_VALID)) 351 if (!(status & ACPI_EVENT_FLAG_HANDLE))
350 size += sprintf(buf + size, " invalid"); 352 size += sprintf(buf + size, " invalid");
351 else if (status & ACPI_EVENT_FLAG_ENABLED) 353 else if (status & ACPI_EVENT_FLAG_ENABLED)
352 size += sprintf(buf + size, " enable"); 354 size += sprintf(buf + size, " enabled");
355 else if (status & ACPI_EVENT_FLAG_WAKE_ENABLED)
356 size += sprintf(buf + size, " wake_enabled");
353 else 357 else
354 size += sprintf(buf + size, " disable"); 358 size += sprintf(buf + size, " disabled");
355 359
356end: 360end:
357 size += sprintf(buf + size, "\n"); 361 size += sprintf(buf + size, "\n");
@@ -385,7 +389,7 @@ static ssize_t counter_set(struct kobject *kobj,
385 if (result) 389 if (result)
386 goto end; 390 goto end;
387 391
388 if (!(all_counters[index].flags & ACPI_EVENT_VALID)) { 392 if (!(status & ACPI_EVENT_FLAG_HANDLE)) {
389 printk(KERN_WARNING PREFIX 393 printk(KERN_WARNING PREFIX
390 "Can not change Invalid GPE/Fixed Event status\n"); 394 "Can not change Invalid GPE/Fixed Event status\n");
391 return -EINVAL; 395 return -EINVAL;
@@ -394,10 +398,10 @@ static ssize_t counter_set(struct kobject *kobj,
394 if (index < num_gpes) { 398 if (index < num_gpes) {
395 if (!strcmp(buf, "disable\n") && 399 if (!strcmp(buf, "disable\n") &&
396 (status & ACPI_EVENT_FLAG_ENABLED)) 400 (status & ACPI_EVENT_FLAG_ENABLED))
397 result = acpi_disable_gpe(handle, index, ACPI_NOT_ISR); 401 result = acpi_disable_gpe(handle, index);
398 else if (!strcmp(buf, "enable\n") && 402 else if (!strcmp(buf, "enable\n") &&
399 !(status & ACPI_EVENT_FLAG_ENABLED)) 403 !(status & ACPI_EVENT_FLAG_ENABLED))
400 result = acpi_enable_gpe(handle, index, ACPI_NOT_ISR); 404 result = acpi_enable_gpe(handle, index);
401 else if (!strcmp(buf, "clear\n") && 405 else if (!strcmp(buf, "clear\n") &&
402 (status & ACPI_EVENT_FLAG_SET)) 406 (status & ACPI_EVENT_FLAG_SET))
403 result = acpi_clear_gpe(handle, index, ACPI_NOT_ISR); 407 result = acpi_clear_gpe(handle, index, ACPI_NOT_ISR);
diff --git a/drivers/acpi/tables/tbfadt.c b/drivers/acpi/tables/tbfadt.c
index 2c7885e7ffba..2817158fb6a1 100644
--- a/drivers/acpi/tables/tbfadt.c
+++ b/drivers/acpi/tables/tbfadt.c
@@ -304,7 +304,7 @@ static void acpi_tb_convert_fadt(void)
304 * The ACPI 1.0 reserved fields that will be zeroed are the bytes located at 304 * The ACPI 1.0 reserved fields that will be zeroed are the bytes located at
305 * offset 45, 55, 95, and the word located at offset 109, 110. 305 * offset 45, 55, 95, and the word located at offset 109, 110.
306 */ 306 */
307 if (acpi_gbl_FADT.header.revision < 3) { 307 if (acpi_gbl_FADT.header.revision < FADT2_REVISION_ID) {
308 acpi_gbl_FADT.preferred_profile = 0; 308 acpi_gbl_FADT.preferred_profile = 0;
309 acpi_gbl_FADT.pstate_control = 0; 309 acpi_gbl_FADT.pstate_control = 0;
310 acpi_gbl_FADT.cst_control = 0; 310 acpi_gbl_FADT.cst_control = 0;
diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c
index ad6cae938f0b..073ff09218a9 100644
--- a/drivers/acpi/thermal.c
+++ b/drivers/acpi/thermal.c
@@ -47,7 +47,6 @@
47#include <acpi/acpi_bus.h> 47#include <acpi/acpi_bus.h>
48#include <acpi/acpi_drivers.h> 48#include <acpi/acpi_drivers.h>
49 49
50#define ACPI_THERMAL_COMPONENT 0x04000000
51#define ACPI_THERMAL_CLASS "thermal_zone" 50#define ACPI_THERMAL_CLASS "thermal_zone"
52#define ACPI_THERMAL_DEVICE_NAME "Thermal Zone" 51#define ACPI_THERMAL_DEVICE_NAME "Thermal Zone"
53#define ACPI_THERMAL_FILE_STATE "state" 52#define ACPI_THERMAL_FILE_STATE "state"
@@ -576,7 +575,7 @@ static int acpi_thermal_critical(struct acpi_thermal *tz)
576 acpi_bus_generate_proc_event(tz->device, ACPI_THERMAL_NOTIFY_CRITICAL, 575 acpi_bus_generate_proc_event(tz->device, ACPI_THERMAL_NOTIFY_CRITICAL,
577 tz->trips.critical.flags.enabled); 576 tz->trips.critical.flags.enabled);
578 acpi_bus_generate_netlink_event(tz->device->pnp.device_class, 577 acpi_bus_generate_netlink_event(tz->device->pnp.device_class,
579 tz->device->dev.bus_id, 578 dev_name(&tz->device->dev),
580 ACPI_THERMAL_NOTIFY_CRITICAL, 579 ACPI_THERMAL_NOTIFY_CRITICAL,
581 tz->trips.critical.flags.enabled); 580 tz->trips.critical.flags.enabled);
582 581
@@ -605,7 +604,7 @@ static int acpi_thermal_hot(struct acpi_thermal *tz)
605 acpi_bus_generate_proc_event(tz->device, ACPI_THERMAL_NOTIFY_HOT, 604 acpi_bus_generate_proc_event(tz->device, ACPI_THERMAL_NOTIFY_HOT,
606 tz->trips.hot.flags.enabled); 605 tz->trips.hot.flags.enabled);
607 acpi_bus_generate_netlink_event(tz->device->pnp.device_class, 606 acpi_bus_generate_netlink_event(tz->device->pnp.device_class,
608 tz->device->dev.bus_id, 607 dev_name(&tz->device->dev),
609 ACPI_THERMAL_NOTIFY_HOT, 608 ACPI_THERMAL_NOTIFY_HOT,
610 tz->trips.hot.flags.enabled); 609 tz->trips.hot.flags.enabled);
611 610
@@ -1592,14 +1591,14 @@ static void acpi_thermal_notify(acpi_handle handle, u32 event, void *data)
1592 acpi_thermal_check(tz); 1591 acpi_thermal_check(tz);
1593 acpi_bus_generate_proc_event(device, event, 0); 1592 acpi_bus_generate_proc_event(device, event, 0);
1594 acpi_bus_generate_netlink_event(device->pnp.device_class, 1593 acpi_bus_generate_netlink_event(device->pnp.device_class,
1595 device->dev.bus_id, event, 0); 1594 dev_name(&device->dev), event, 0);
1596 break; 1595 break;
1597 case ACPI_THERMAL_NOTIFY_DEVICES: 1596 case ACPI_THERMAL_NOTIFY_DEVICES:
1598 acpi_thermal_trips_update(tz, ACPI_TRIPS_REFRESH_DEVICES); 1597 acpi_thermal_trips_update(tz, ACPI_TRIPS_REFRESH_DEVICES);
1599 acpi_thermal_check(tz); 1598 acpi_thermal_check(tz);
1600 acpi_bus_generate_proc_event(device, event, 0); 1599 acpi_bus_generate_proc_event(device, event, 0);
1601 acpi_bus_generate_netlink_event(device->pnp.device_class, 1600 acpi_bus_generate_netlink_event(device->pnp.device_class,
1602 device->dev.bus_id, event, 0); 1601 dev_name(&device->dev), event, 0);
1603 break; 1602 break;
1604 default: 1603 default:
1605 ACPI_DEBUG_PRINT((ACPI_DB_INFO, 1604 ACPI_DEBUG_PRINT((ACPI_DB_INFO,
diff --git a/drivers/acpi/toshiba_acpi.c b/drivers/acpi/toshiba_acpi.c
index 66aac06f2ac5..40e60fc2e596 100644
--- a/drivers/acpi/toshiba_acpi.c
+++ b/drivers/acpi/toshiba_acpi.c
@@ -824,34 +824,36 @@ static int __init toshiba_acpi_init(void)
824 toshiba_acpi_exit(); 824 toshiba_acpi_exit();
825 return -ENOMEM; 825 return -ENOMEM;
826 } 826 }
827 }
828 827
829 /* Register input device for kill switch */ 828 /* Register input device for kill switch */
830 toshiba_acpi.poll_dev = input_allocate_polled_device(); 829 toshiba_acpi.poll_dev = input_allocate_polled_device();
831 if (!toshiba_acpi.poll_dev) { 830 if (!toshiba_acpi.poll_dev) {
832 printk(MY_ERR "unable to allocate kill-switch input device\n"); 831 printk(MY_ERR
833 toshiba_acpi_exit(); 832 "unable to allocate kill-switch input device\n");
834 return -ENOMEM; 833 toshiba_acpi_exit();
835 } 834 return -ENOMEM;
836 toshiba_acpi.poll_dev->private = &toshiba_acpi; 835 }
837 toshiba_acpi.poll_dev->poll = bt_poll_rfkill; 836 toshiba_acpi.poll_dev->private = &toshiba_acpi;
838 toshiba_acpi.poll_dev->poll_interval = 1000; /* msecs */ 837 toshiba_acpi.poll_dev->poll = bt_poll_rfkill;
839 838 toshiba_acpi.poll_dev->poll_interval = 1000; /* msecs */
840 toshiba_acpi.poll_dev->input->name = toshiba_acpi.rfk_name; 839
841 toshiba_acpi.poll_dev->input->id.bustype = BUS_HOST; 840 toshiba_acpi.poll_dev->input->name = toshiba_acpi.rfk_name;
842 toshiba_acpi.poll_dev->input->id.vendor = 0x0930; /* Toshiba USB ID */ 841 toshiba_acpi.poll_dev->input->id.bustype = BUS_HOST;
843 set_bit(EV_SW, toshiba_acpi.poll_dev->input->evbit); 842 /* Toshiba USB ID */
844 set_bit(SW_RFKILL_ALL, toshiba_acpi.poll_dev->input->swbit); 843 toshiba_acpi.poll_dev->input->id.vendor = 0x0930;
845 input_report_switch(toshiba_acpi.poll_dev->input, SW_RFKILL_ALL, TRUE); 844 set_bit(EV_SW, toshiba_acpi.poll_dev->input->evbit);
846 input_sync(toshiba_acpi.poll_dev->input); 845 set_bit(SW_RFKILL_ALL, toshiba_acpi.poll_dev->input->swbit);
847 846 input_report_switch(toshiba_acpi.poll_dev->input,
848 ret = input_register_polled_device(toshiba_acpi.poll_dev); 847 SW_RFKILL_ALL, TRUE);
849 if (ret) { 848 input_sync(toshiba_acpi.poll_dev->input);
850 printk(MY_ERR "unable to register kill-switch input device\n"); 849
851 rfkill_free(toshiba_acpi.rfk_dev); 850 ret = input_register_polled_device(toshiba_acpi.poll_dev);
852 toshiba_acpi.rfk_dev = NULL; 851 if (ret) {
853 toshiba_acpi_exit(); 852 printk(MY_ERR
854 return ret; 853 "unable to register kill-switch input device\n");
854 toshiba_acpi_exit();
855 return ret;
856 }
855 } 857 }
856 858
857 return 0; 859 return 0;
diff --git a/drivers/acpi/utils.c b/drivers/acpi/utils.c
index e827be36ee8d..f844941089bb 100644
--- a/drivers/acpi/utils.c
+++ b/drivers/acpi/utils.c
@@ -259,34 +259,26 @@ acpi_evaluate_integer(acpi_handle handle,
259 struct acpi_object_list *arguments, unsigned long long *data) 259 struct acpi_object_list *arguments, unsigned long long *data)
260{ 260{
261 acpi_status status = AE_OK; 261 acpi_status status = AE_OK;
262 union acpi_object *element; 262 union acpi_object element;
263 struct acpi_buffer buffer = { 0, NULL }; 263 struct acpi_buffer buffer = { 0, NULL };
264 264
265
266 if (!data) 265 if (!data)
267 return AE_BAD_PARAMETER; 266 return AE_BAD_PARAMETER;
268 267
269 element = kzalloc(sizeof(union acpi_object), irqs_disabled() ? GFP_ATOMIC: GFP_KERNEL);
270 if (!element)
271 return AE_NO_MEMORY;
272
273 buffer.length = sizeof(union acpi_object); 268 buffer.length = sizeof(union acpi_object);
274 buffer.pointer = element; 269 buffer.pointer = &element;
275 status = acpi_evaluate_object(handle, pathname, arguments, &buffer); 270 status = acpi_evaluate_object(handle, pathname, arguments, &buffer);
276 if (ACPI_FAILURE(status)) { 271 if (ACPI_FAILURE(status)) {
277 acpi_util_eval_error(handle, pathname, status); 272 acpi_util_eval_error(handle, pathname, status);
278 kfree(element);
279 return status; 273 return status;
280 } 274 }
281 275
282 if (element->type != ACPI_TYPE_INTEGER) { 276 if (element.type != ACPI_TYPE_INTEGER) {
283 acpi_util_eval_error(handle, pathname, AE_BAD_DATA); 277 acpi_util_eval_error(handle, pathname, AE_BAD_DATA);
284 kfree(element);
285 return AE_BAD_DATA; 278 return AE_BAD_DATA;
286 } 279 }
287 280
288 *data = element->integer.value; 281 *data = element.integer.value;
289 kfree(element);
290 282
291 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Return value [%llu]\n", *data)); 283 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Return value [%llu]\n", *data));
292 284
diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c
index a29b0ccac65a..baa441929720 100644
--- a/drivers/acpi/video.c
+++ b/drivers/acpi/video.c
@@ -41,7 +41,6 @@
41#include <acpi/acpi_bus.h> 41#include <acpi/acpi_bus.h>
42#include <acpi/acpi_drivers.h> 42#include <acpi/acpi_drivers.h>
43 43
44#define ACPI_VIDEO_COMPONENT 0x08000000
45#define ACPI_VIDEO_CLASS "video" 44#define ACPI_VIDEO_CLASS "video"
46#define ACPI_VIDEO_BUS_NAME "Video Bus" 45#define ACPI_VIDEO_BUS_NAME "Video Bus"
47#define ACPI_VIDEO_DEVICE_NAME "Video Device" 46#define ACPI_VIDEO_DEVICE_NAME "Video Device"
@@ -739,7 +738,8 @@ static void acpi_video_device_find_cap(struct acpi_video_device *device)
739 device->cap._DSS = 1; 738 device->cap._DSS = 1;
740 } 739 }
741 740
742 max_level = acpi_video_init_brightness(device); 741 if (acpi_video_backlight_support())
742 max_level = acpi_video_init_brightness(device);
743 743
744 if (device->cap._BCL && device->cap._BCM && max_level > 0) { 744 if (device->cap._BCL && device->cap._BCM && max_level > 0) {
745 int result; 745 int result;
@@ -785,18 +785,21 @@ static void acpi_video_device_find_cap(struct acpi_video_device *device)
785 printk(KERN_ERR PREFIX "Create sysfs link\n"); 785 printk(KERN_ERR PREFIX "Create sysfs link\n");
786 786
787 } 787 }
788 if (device->cap._DCS && device->cap._DSS){ 788
789 static int count = 0; 789 if (acpi_video_display_switch_support()) {
790 char *name; 790
791 name = kzalloc(MAX_NAME_LEN, GFP_KERNEL); 791 if (device->cap._DCS && device->cap._DSS) {
792 if (!name) 792 static int count;
793 return; 793 char *name;
794 sprintf(name, "acpi_video%d", count++); 794 name = kzalloc(MAX_NAME_LEN, GFP_KERNEL);
795 device->output_dev = video_output_register(name, 795 if (!name)
796 NULL, device, &acpi_output_properties); 796 return;
797 kfree(name); 797 sprintf(name, "acpi_video%d", count++);
798 device->output_dev = video_output_register(name,
799 NULL, device, &acpi_output_properties);
800 kfree(name);
801 }
798 } 802 }
799 return;
800} 803}
801 804
802/* 805/*
@@ -842,11 +845,16 @@ static void acpi_video_bus_find_cap(struct acpi_video_bus *video)
842static int acpi_video_bus_check(struct acpi_video_bus *video) 845static int acpi_video_bus_check(struct acpi_video_bus *video)
843{ 846{
844 acpi_status status = -ENOENT; 847 acpi_status status = -ENOENT;
845 848 struct device *dev;
846 849
847 if (!video) 850 if (!video)
848 return -EINVAL; 851 return -EINVAL;
849 852
853 dev = acpi_get_physical_pci_device(video->device->handle);
854 if (!dev)
855 return -ENODEV;
856 put_device(dev);
857
850 /* Since there is no HID, CID and so on for VGA driver, we have 858 /* Since there is no HID, CID and so on for VGA driver, we have
851 * to check well known required nodes. 859 * to check well known required nodes.
852 */ 860 */
@@ -2094,12 +2102,6 @@ static int __init acpi_video_init(void)
2094{ 2102{
2095 int result = 0; 2103 int result = 0;
2096 2104
2097
2098 /*
2099 acpi_dbg_level = 0xFFFFFFFF;
2100 acpi_dbg_layer = 0x08000000;
2101 */
2102
2103 acpi_video_dir = proc_mkdir(ACPI_VIDEO_CLASS, acpi_root_dir); 2105 acpi_video_dir = proc_mkdir(ACPI_VIDEO_CLASS, acpi_root_dir);
2104 if (!acpi_video_dir) 2106 if (!acpi_video_dir)
2105 return -ENODEV; 2107 return -ENODEV;
diff --git a/drivers/acpi/video_detect.c b/drivers/acpi/video_detect.c
new file mode 100644
index 000000000000..f022eb6f5637
--- /dev/null
+++ b/drivers/acpi/video_detect.c
@@ -0,0 +1,267 @@
1/*
2 * Copyright (C) 2008 SuSE Linux Products GmbH
3 * Thomas Renninger <trenn@suse.de>
4 *
5 * May be copied or modified under the terms of the GNU General Public License
6 *
7 * video_detect.c:
8 * Provides acpi_is_video_device() for early scanning of ACPI devices in scan.c
9 * There a Linux specific (Spec does not provide a HID for video devices) is
10 * assinged
11 *
12 * After PCI devices are glued with ACPI devices
13 * acpi_get_physical_pci_device() can be called to identify ACPI graphics
14 * devices for which a real graphics card is plugged in
15 *
16 * Now acpi_video_get_capabilities() can be called to check which
17 * capabilities the graphics cards plugged in support. The check for general
18 * video capabilities will be triggered by the first caller of
19 * acpi_video_get_capabilities(NULL); which will happen when the first
20 * backlight (or display output) switching supporting driver calls:
21 * acpi_video_backlight_support();
22 *
23 * Depending on whether ACPI graphics extensions (cmp. ACPI spec Appendix B)
24 * are available, video.ko should be used to handle the device.
25 *
26 * Otherwise vendor specific drivers like thinkpad_acpi, asus_acpi,
27 * sony_acpi,... can take care about backlight brightness and display output
28 * switching.
29 *
30 * If CONFIG_ACPI_VIDEO is neither set as "compiled in" (y) nor as a module (m)
31 * this file will not be compiled, acpi_video_get_capabilities() and
32 * acpi_video_backlight_support() will always return 0 and vendor specific
33 * drivers always can handle backlight.
34 *
35 */
36
37#include <linux/acpi.h>
38#include <linux/dmi.h>
39
40ACPI_MODULE_NAME("video");
41#define _COMPONENT ACPI_VIDEO_COMPONENT
42
43static long acpi_video_support;
44static bool acpi_video_caps_checked;
45
46static acpi_status
47acpi_backlight_cap_match(acpi_handle handle, u32 level, void *context,
48 void **retyurn_value)
49{
50 long *cap = context;
51 acpi_handle h_dummy;
52
53 if (ACPI_SUCCESS(acpi_get_handle(handle, "_BCM", &h_dummy)) &&
54 ACPI_SUCCESS(acpi_get_handle(handle, "_BCL", &h_dummy))) {
55 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found generic backlight "
56 "support\n"));
57 *cap |= ACPI_VIDEO_BACKLIGHT;
58 /* We have backlight support, no need to scan further */
59 return AE_CTRL_TERMINATE;
60 }
61 return 0;
62}
63
64/* Returns true if the device is a video device which can be handled by
65 * video.ko.
66 * The device will get a Linux specific CID added in scan.c to
67 * identify the device as an ACPI graphics device
68 * Be aware that the graphics device may not be physically present
69 * Use acpi_video_get_capabilities() to detect general ACPI video
70 * capabilities of present cards
71 */
72long acpi_is_video_device(struct acpi_device *device)
73{
74 acpi_handle h_dummy;
75 long video_caps = 0;
76
77 if (!device)
78 return 0;
79
80 /* Does this device able to support video switching ? */
81 if (ACPI_SUCCESS(acpi_get_handle(device->handle, "_DOD", &h_dummy)) &&
82 ACPI_SUCCESS(acpi_get_handle(device->handle, "_DOS", &h_dummy)))
83 video_caps |= ACPI_VIDEO_OUTPUT_SWITCHING;
84
85 /* Does this device able to retrieve a video ROM ? */
86 if (ACPI_SUCCESS(acpi_get_handle(device->handle, "_ROM", &h_dummy)))
87 video_caps |= ACPI_VIDEO_ROM_AVAILABLE;
88
89 /* Does this device able to configure which video head to be POSTed ? */
90 if (ACPI_SUCCESS(acpi_get_handle(device->handle, "_VPO", &h_dummy)) &&
91 ACPI_SUCCESS(acpi_get_handle(device->handle, "_GPD", &h_dummy)) &&
92 ACPI_SUCCESS(acpi_get_handle(device->handle, "_SPD", &h_dummy)))
93 video_caps |= ACPI_VIDEO_DEVICE_POSTING;
94
95 /* Only check for backlight functionality if one of the above hit. */
96 if (video_caps)
97 acpi_walk_namespace(ACPI_TYPE_DEVICE, device->handle,
98 ACPI_UINT32_MAX, acpi_backlight_cap_match,
99 &video_caps, NULL);
100
101 return video_caps;
102}
103EXPORT_SYMBOL(acpi_is_video_device);
104
105static acpi_status
106find_video(acpi_handle handle, u32 lvl, void *context, void **rv)
107{
108 long *cap = context;
109 struct device *dev;
110 struct acpi_device *acpi_dev;
111
112 const struct acpi_device_id video_ids[] = {
113 {ACPI_VIDEO_HID, 0},
114 {"", 0},
115 };
116 if (acpi_bus_get_device(handle, &acpi_dev))
117 return AE_OK;
118
119 if (!acpi_match_device_ids(acpi_dev, video_ids)) {
120 dev = acpi_get_physical_pci_device(handle);
121 if (!dev)
122 return AE_OK;
123 put_device(dev);
124 *cap |= acpi_is_video_device(acpi_dev);
125 }
126 return AE_OK;
127}
128
129/*
130 * Returns the video capabilities of a specific ACPI graphics device
131 *
132 * if NULL is passed as argument all ACPI devices are enumerated and
133 * all graphics capabilities of physically present devices are
134 * summerized and returned. This is cached and done only once.
135 */
136long acpi_video_get_capabilities(acpi_handle graphics_handle)
137{
138 long caps = 0;
139 struct acpi_device *tmp_dev;
140 acpi_status status;
141
142 if (acpi_video_caps_checked && graphics_handle == NULL)
143 return acpi_video_support;
144
145 if (!graphics_handle) {
146 /* Only do the global walk through all graphics devices once */
147 acpi_walk_namespace(ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT,
148 ACPI_UINT32_MAX, find_video,
149 &caps, NULL);
150 /* There might be boot param flags set already... */
151 acpi_video_support |= caps;
152 acpi_video_caps_checked = 1;
153 /* Add blacklists here. Be careful to use the right *DMI* bits
154 * to still be able to override logic via boot params, e.g.:
155 *
156 * if (dmi_name_in_vendors("XY")) {
157 * acpi_video_support |=
158 * ACPI_VIDEO_OUTPUT_SWITCHING_DMI_VENDOR;
159 * acpi_video_support |=
160 * ACPI_VIDEO_BACKLIGHT_DMI_VENDOR;
161 *}
162 */
163 } else {
164 status = acpi_bus_get_device(graphics_handle, &tmp_dev);
165 if (ACPI_FAILURE(status)) {
166 ACPI_EXCEPTION((AE_INFO, status, "Invalid device"));
167 return 0;
168 }
169 acpi_walk_namespace(ACPI_TYPE_DEVICE, graphics_handle,
170 ACPI_UINT32_MAX, find_video,
171 &caps, NULL);
172 }
173 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "We have 0x%lX video support %s %s\n",
174 graphics_handle ? caps : acpi_video_support,
175 graphics_handle ? "on device " : "in general",
176 graphics_handle ? acpi_device_bid(tmp_dev) : ""));
177 return caps;
178}
179EXPORT_SYMBOL(acpi_video_get_capabilities);
180
181/* Returns true if video.ko can do backlight switching */
182int acpi_video_backlight_support(void)
183{
184 /*
185 * We must check whether the ACPI graphics device is physically plugged
186 * in. Therefore this must be called after binding PCI and ACPI devices
187 */
188 if (!acpi_video_caps_checked)
189 acpi_video_get_capabilities(NULL);
190
191 /* First check for boot param -> highest prio */
192 if (acpi_video_support & ACPI_VIDEO_BACKLIGHT_FORCE_VENDOR)
193 return 0;
194 else if (acpi_video_support & ACPI_VIDEO_BACKLIGHT_FORCE_VIDEO)
195 return 1;
196
197 /* Then check for DMI blacklist -> second highest prio */
198 if (acpi_video_support & ACPI_VIDEO_BACKLIGHT_DMI_VENDOR)
199 return 0;
200 else if (acpi_video_support & ACPI_VIDEO_BACKLIGHT_DMI_VIDEO)
201 return 1;
202
203 /* Then go the default way */
204 return acpi_video_support & ACPI_VIDEO_BACKLIGHT;
205}
206EXPORT_SYMBOL(acpi_video_backlight_support);
207
208/*
209 * Returns true if video.ko can do display output switching.
210 * This does not work well/at all with binary graphics drivers
211 * which disable system io ranges and do it on their own.
212 */
213int acpi_video_display_switch_support(void)
214{
215 if (!acpi_video_caps_checked)
216 acpi_video_get_capabilities(NULL);
217
218 if (acpi_video_support & ACPI_VIDEO_OUTPUT_SWITCHING_FORCE_VENDOR)
219 return 0;
220 else if (acpi_video_support & ACPI_VIDEO_OUTPUT_SWITCHING_FORCE_VIDEO)
221 return 1;
222
223 if (acpi_video_support & ACPI_VIDEO_OUTPUT_SWITCHING_DMI_VENDOR)
224 return 0;
225 else if (acpi_video_support & ACPI_VIDEO_OUTPUT_SWITCHING_DMI_VIDEO)
226 return 1;
227
228 return acpi_video_support & ACPI_VIDEO_OUTPUT_SWITCHING;
229}
230EXPORT_SYMBOL(acpi_video_display_switch_support);
231
232/*
233 * Use acpi_display_output=vendor/video or acpi_backlight=vendor/video
234 * To force that backlight or display output switching is processed by vendor
235 * specific acpi drivers or video.ko driver.
236 */
237int __init acpi_backlight(char *str)
238{
239 if (str == NULL || *str == '\0')
240 return 1;
241 else {
242 if (!strcmp("vendor", str))
243 acpi_video_support |=
244 ACPI_VIDEO_BACKLIGHT_FORCE_VENDOR;
245 if (!strcmp("video", str))
246 acpi_video_support |=
247 ACPI_VIDEO_OUTPUT_SWITCHING_FORCE_VIDEO;
248 }
249 return 1;
250}
251__setup("acpi_backlight=", acpi_backlight);
252
253int __init acpi_display_output(char *str)
254{
255 if (str == NULL || *str == '\0')
256 return 1;
257 else {
258 if (!strcmp("vendor", str))
259 acpi_video_support |=
260 ACPI_VIDEO_OUTPUT_SWITCHING_FORCE_VENDOR;
261 if (!strcmp("video", str))
262 acpi_video_support |=
263 ACPI_VIDEO_OUTPUT_SWITCHING_FORCE_VIDEO;
264 }
265 return 1;
266}
267__setup("acpi_display_output=", acpi_display_output);
diff --git a/drivers/acpi/wmi.c b/drivers/acpi/wmi.c
index 47cd7baf9b1b..8a8b377712c9 100644
--- a/drivers/acpi/wmi.c
+++ b/drivers/acpi/wmi.c
@@ -660,7 +660,7 @@ static void acpi_wmi_notify(acpi_handle handle, u32 event, void *data)
660 wblock->handler(event, wblock->handler_data); 660 wblock->handler(event, wblock->handler_data);
661 661
662 acpi_bus_generate_netlink_event( 662 acpi_bus_generate_netlink_event(
663 device->pnp.device_class, device->dev.bus_id, 663 device->pnp.device_class, dev_name(&device->dev),
664 event, 0); 664 event, 0);
665 break; 665 break;
666 } 666 }