aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi')
-rw-r--r--drivers/acpi/Kconfig1
-rw-r--r--drivers/acpi/Makefile2
-rw-r--r--drivers/acpi/processor_core.c15
-rw-r--r--drivers/acpi/processor_idle.c29
-rw-r--r--drivers/acpi/scan.c2
-rw-r--r--drivers/acpi/video.c2
6 files changed, 42 insertions, 9 deletions
diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig
index fe1e8126fbae..fce21c257523 100644
--- a/drivers/acpi/Kconfig
+++ b/drivers/acpi/Kconfig
@@ -197,7 +197,6 @@ config ACPI_ASUS
197config ACPI_IBM 197config ACPI_IBM
198 tristate "IBM ThinkPad Laptop Extras" 198 tristate "IBM ThinkPad Laptop Extras"
199 depends on X86 199 depends on X86
200 default y
201 ---help--- 200 ---help---
202 This is a Linux ACPI driver for the IBM ThinkPad laptops. It adds 201 This is a Linux ACPI driver for the IBM ThinkPad laptops. It adds
203 support for Fn-Fx key combinations, Bluetooth control, video 202 support for Fn-Fx key combinations, Bluetooth control, video
diff --git a/drivers/acpi/Makefile b/drivers/acpi/Makefile
index a18243488c66..5984b4f6715a 100644
--- a/drivers/acpi/Makefile
+++ b/drivers/acpi/Makefile
@@ -16,7 +16,7 @@ EXTRA_CFLAGS += $(ACPI_CFLAGS)
16# ACPI Boot-Time Table Parsing 16# ACPI Boot-Time Table Parsing
17# 17#
18obj-y += tables.o 18obj-y += tables.o
19obj-y += blacklist.o 19obj-$(CONFIG_X86) += blacklist.o
20 20
21# 21#
22# ACPI Core Subsystem (Interpreter) 22# ACPI Core Subsystem (Interpreter)
diff --git a/drivers/acpi/processor_core.c b/drivers/acpi/processor_core.c
index 421792562642..0c561c571f29 100644
--- a/drivers/acpi/processor_core.c
+++ b/drivers/acpi/processor_core.c
@@ -543,6 +543,8 @@ static int acpi_processor_get_info(struct acpi_processor *pr)
543 return_VALUE(0); 543 return_VALUE(0);
544} 544}
545 545
546static void *processor_device_array[NR_CPUS];
547
546static int acpi_processor_start(struct acpi_device *device) 548static int acpi_processor_start(struct acpi_device *device)
547{ 549{
548 int result = 0; 550 int result = 0;
@@ -561,6 +563,19 @@ static int acpi_processor_start(struct acpi_device *device)
561 563
562 BUG_ON((pr->id >= NR_CPUS) || (pr->id < 0)); 564 BUG_ON((pr->id >= NR_CPUS) || (pr->id < 0));
563 565
566 /*
567 * Buggy BIOS check
568 * ACPI id of processors can be reported wrongly by the BIOS.
569 * Don't trust it blindly
570 */
571 if (processor_device_array[pr->id] != NULL &&
572 processor_device_array[pr->id] != (void *)device) {
573 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "BIOS reporting wrong ACPI id"
574 "for the processor\n"));
575 return_VALUE(-ENODEV);
576 }
577 processor_device_array[pr->id] = (void *)device;
578
564 processors[pr->id] = pr; 579 processors[pr->id] = pr;
565 580
566 result = acpi_processor_add_fs(device); 581 result = acpi_processor_add_fs(device);
diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c
index 70d8a6ec0920..83fd1b6c10c4 100644
--- a/drivers/acpi/processor_idle.c
+++ b/drivers/acpi/processor_idle.c
@@ -280,6 +280,16 @@ static void acpi_processor_idle(void)
280 280
281 cx->usage++; 281 cx->usage++;
282 282
283#ifdef CONFIG_HOTPLUG_CPU
284 /*
285 * Check for P_LVL2_UP flag before entering C2 and above on
286 * an SMP system. We do it here instead of doing it at _CST/P_LVL
287 * detection phase, to work cleanly with logical CPU hotplug.
288 */
289 if ((cx->type != ACPI_STATE_C1) && (num_online_cpus() > 1) &&
290 !pr->flags.has_cst && acpi_fadt.plvl2_up)
291 cx->type = ACPI_STATE_C1;
292#endif
283 /* 293 /*
284 * Sleep: 294 * Sleep:
285 * ------ 295 * ------
@@ -534,6 +544,15 @@ static int acpi_processor_get_power_info_fadt(struct acpi_processor *pr)
534 pr->power.states[ACPI_STATE_C0].valid = 1; 544 pr->power.states[ACPI_STATE_C0].valid = 1;
535 pr->power.states[ACPI_STATE_C1].valid = 1; 545 pr->power.states[ACPI_STATE_C1].valid = 1;
536 546
547#ifndef CONFIG_HOTPLUG_CPU
548 /*
549 * Check for P_LVL2_UP flag before entering C2 and above on
550 * an SMP system.
551 */
552 if ((num_online_cpus() > 1) && acpi_fadt.plvl2_up)
553 return_VALUE(-ENODEV);
554#endif
555
537 /* determine C2 and C3 address from pblk */ 556 /* determine C2 and C3 address from pblk */
538 pr->power.states[ACPI_STATE_C2].address = pr->pblk + 4; 557 pr->power.states[ACPI_STATE_C2].address = pr->pblk + 4;
539 pr->power.states[ACPI_STATE_C3].address = pr->pblk + 5; 558 pr->power.states[ACPI_STATE_C3].address = pr->pblk + 5;
@@ -690,7 +709,7 @@ static int acpi_processor_get_power_info_cst(struct acpi_processor *pr)
690 709
691 /* Validate number of power states discovered */ 710 /* Validate number of power states discovered */
692 if (pr->power.count < 2) 711 if (pr->power.count < 2)
693 status = -ENODEV; 712 status = -EFAULT;
694 713
695 end: 714 end:
696 acpi_os_free(buffer.pointer); 715 acpi_os_free(buffer.pointer);
@@ -841,11 +860,11 @@ static int acpi_processor_get_power_info(struct acpi_processor *pr)
841 * this function */ 860 * this function */
842 861
843 result = acpi_processor_get_power_info_cst(pr); 862 result = acpi_processor_get_power_info_cst(pr);
844 if ((result) || (acpi_processor_power_verify(pr) < 2)) { 863 if (result == -ENODEV)
845 result = acpi_processor_get_power_info_fadt(pr); 864 result = acpi_processor_get_power_info_fadt(pr);
846 if ((result) || (acpi_processor_power_verify(pr) < 2)) 865
847 result = acpi_processor_get_power_info_default_c1(pr); 866 if ((result) || (acpi_processor_power_verify(pr) < 2))
848 } 867 result = acpi_processor_get_power_info_default_c1(pr);
849 868
850 /* 869 /*
851 * Set Default Policy 870 * Set Default Policy
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
index 23e2c6968a11..31218e1d2a18 100644
--- a/drivers/acpi/scan.c
+++ b/drivers/acpi/scan.c
@@ -1110,7 +1110,7 @@ acpi_add_single_object(struct acpi_device **child,
1110 * 1110 *
1111 * TBD: Assumes LDM provides driver hot-plug capability. 1111 * TBD: Assumes LDM provides driver hot-plug capability.
1112 */ 1112 */
1113 result = acpi_bus_find_driver(device); 1113 acpi_bus_find_driver(device);
1114 1114
1115 end: 1115 end:
1116 if (!result) 1116 if (!result)
diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c
index f051b151580d..d10668f14699 100644
--- a/drivers/acpi/video.c
+++ b/drivers/acpi/video.c
@@ -812,7 +812,7 @@ acpi_video_device_write_brightness(struct file *file,
812 812
813 ACPI_FUNCTION_TRACE("acpi_video_device_write_brightness"); 813 ACPI_FUNCTION_TRACE("acpi_video_device_write_brightness");
814 814
815 if (!dev || count + 1 > sizeof str) 815 if (!dev || !dev->brightness || count + 1 > sizeof str)
816 return_VALUE(-EINVAL); 816 return_VALUE(-EINVAL);
817 817
818 if (copy_from_user(str, buffer, count)) 818 if (copy_from_user(str, buffer, count))