aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-01-31 12:23:52 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2014-01-31 12:23:52 -0500
commitb890eb4ecc718907223a3b7b7b069b59b33f28ef (patch)
tree6c97e9a60e402525766073bf2fd8bf62916cf97a /drivers
parentaafd9d6a46745926648cb5d0b68b108e79ceb8d4 (diff)
parent88ea0f2c02f461613dd67664a79db525e9723609 (diff)
Merge tag 'pm+acpi-3.14-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull ACPI and power management fixes and cleanups from Rafael Wysocki: - ACPI device hotplug fix preventing ACPI drivers from binding to device objects that acpi_bus_trim() has been called for and the devices represented by them may not be operational. - Recent cpufreq changes related to the "boost" (turbo) feature broke the acpi-cpufreq error code path causing a NULL pointer dereference to occur on some systems. Fix from Konrad Rzeszutek Wilk. - The log level of a CPU initialization error message added recently needs to be reduced, because the particular BIOS issue indicated by it turns out to be widespread and doesn't really matter for the majority of systems having it. From Jiang Liu. - The regulator API needs to be told to stay away from things on systems with ACPI BIOSes or it may conflict with the BIOS' own handling of voltage regulators. Fix from Mark Brown that works around a 3.13 regression in lm90 on PCs occuring if the regulator API is enabled. - Prevent the Exynos4 devfreq driver from being built on multiplatform, because it depends on things that aren't available during such builds. From Sachin Kamat. - Upstream ACPICA doesn't use the bool type as defined in the kernel, so modify the kernel's ACPICA code to follow the upstream in that respect (only one variable definition is affected) to reduce divergences between the two. From Lv Zheng. - Make the ACPI device PM code use ACPI_COMPANION() instead of its own routine doing the same thing (and invokng ACPI_COMPANION() in the process). - Modify some routines in the ACPI processor driver to follow the common convention and return negative integers on errors. From Hanjun Guo. * tag 'pm+acpi-3.14-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: ACPI / scan: Clear match_driver flag in acpi_bus_trim() ACPI / init: Flag use of ACPI and ACPI idioms for power supplies to regulator API acpi-cpufreq: De-register CPU notifier and free struct msr on error. ACPICA: Remove bool usage from ACPICA. PM / devfreq: Disable Exynos4 driver build on multiplatform ACPI / PM: Use ACPI_COMPANION() to get ACPI companions of devices ACPI / scan: reduce log level of "ACPI: \_PR_.CPU4: failed to get CPU APIC ID" ACPI / processor: Return specific error value when mapping lapic id
Diffstat (limited to 'drivers')
-rw-r--r--drivers/acpi/acpi_processor.c2
-rw-r--r--drivers/acpi/acpica/acglobal.h2
-rw-r--r--drivers/acpi/bus.c9
-rw-r--r--drivers/acpi/device_pm.c24
-rw-r--r--drivers/acpi/processor_core.c26
-rw-r--r--drivers/acpi/scan.c1
-rw-r--r--drivers/acpi/sysfs.c2
-rw-r--r--drivers/cpufreq/acpi-cpufreq.c7
-rw-r--r--drivers/devfreq/Kconfig2
9 files changed, 37 insertions, 38 deletions
diff --git a/drivers/acpi/acpi_processor.c b/drivers/acpi/acpi_processor.c
index c9311be29a64..c29c2c3ec0ad 100644
--- a/drivers/acpi/acpi_processor.c
+++ b/drivers/acpi/acpi_processor.c
@@ -261,7 +261,7 @@ static int acpi_processor_get_info(struct acpi_device *device)
261 261
262 apic_id = acpi_get_apicid(pr->handle, device_declaration, pr->acpi_id); 262 apic_id = acpi_get_apicid(pr->handle, device_declaration, pr->acpi_id);
263 if (apic_id < 0) { 263 if (apic_id < 0) {
264 acpi_handle_err(pr->handle, "failed to get CPU APIC ID.\n"); 264 acpi_handle_debug(pr->handle, "failed to get CPU APIC ID.\n");
265 return -ENODEV; 265 return -ENODEV;
266 } 266 }
267 pr->apic_id = apic_id; 267 pr->apic_id = apic_id;
diff --git a/drivers/acpi/acpica/acglobal.h b/drivers/acpi/acpica/acglobal.h
index 24db8e153bf0..4ed1aa384df2 100644
--- a/drivers/acpi/acpica/acglobal.h
+++ b/drivers/acpi/acpica/acglobal.h
@@ -108,7 +108,7 @@ u8 ACPI_INIT_GLOBAL(acpi_gbl_use_default_register_widths, TRUE);
108/* 108/*
109 * Optionally enable output from the AML Debug Object. 109 * Optionally enable output from the AML Debug Object.
110 */ 110 */
111bool ACPI_INIT_GLOBAL(acpi_gbl_enable_aml_debug_object, FALSE); 111u8 ACPI_INIT_GLOBAL(acpi_gbl_enable_aml_debug_object, FALSE);
112 112
113/* 113/*
114 * Optionally copy the entire DSDT to local memory (instead of simply 114 * Optionally copy the entire DSDT to local memory (instead of simply
diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c
index 384da5ab5955..fcb59c21c68d 100644
--- a/drivers/acpi/bus.c
+++ b/drivers/acpi/bus.c
@@ -33,6 +33,7 @@
33#include <linux/proc_fs.h> 33#include <linux/proc_fs.h>
34#include <linux/acpi.h> 34#include <linux/acpi.h>
35#include <linux/slab.h> 35#include <linux/slab.h>
36#include <linux/regulator/machine.h>
36#ifdef CONFIG_X86 37#ifdef CONFIG_X86
37#include <asm/mpspec.h> 38#include <asm/mpspec.h>
38#endif 39#endif
@@ -509,6 +510,14 @@ void __init acpi_early_init(void)
509 goto error0; 510 goto error0;
510 } 511 }
511 512
513 /*
514 * If the system is using ACPI then we can be reasonably
515 * confident that any regulators are managed by the firmware
516 * so tell the regulator core it has everything it needs to
517 * know.
518 */
519 regulator_has_full_constraints();
520
512 return; 521 return;
513 522
514 error0: 523 error0:
diff --git a/drivers/acpi/device_pm.c b/drivers/acpi/device_pm.c
index d49f1e464703..c14a00d3dca6 100644
--- a/drivers/acpi/device_pm.c
+++ b/drivers/acpi/device_pm.c
@@ -727,18 +727,6 @@ int acpi_pm_device_sleep_wake(struct device *dev, bool enable)
727#endif /* CONFIG_PM_SLEEP */ 727#endif /* CONFIG_PM_SLEEP */
728 728
729/** 729/**
730 * acpi_dev_pm_get_node - Get ACPI device node for the given physical device.
731 * @dev: Device to get the ACPI node for.
732 */
733struct acpi_device *acpi_dev_pm_get_node(struct device *dev)
734{
735 acpi_handle handle = ACPI_HANDLE(dev);
736 struct acpi_device *adev;
737
738 return handle && !acpi_bus_get_device(handle, &adev) ? adev : NULL;
739}
740
741/**
742 * acpi_dev_pm_low_power - Put ACPI device into a low-power state. 730 * acpi_dev_pm_low_power - Put ACPI device into a low-power state.
743 * @dev: Device to put into a low-power state. 731 * @dev: Device to put into a low-power state.
744 * @adev: ACPI device node corresponding to @dev. 732 * @adev: ACPI device node corresponding to @dev.
@@ -778,7 +766,7 @@ static int acpi_dev_pm_full_power(struct acpi_device *adev)
778 */ 766 */
779int acpi_dev_runtime_suspend(struct device *dev) 767int acpi_dev_runtime_suspend(struct device *dev)
780{ 768{
781 struct acpi_device *adev = acpi_dev_pm_get_node(dev); 769 struct acpi_device *adev = ACPI_COMPANION(dev);
782 bool remote_wakeup; 770 bool remote_wakeup;
783 int error; 771 int error;
784 772
@@ -809,7 +797,7 @@ EXPORT_SYMBOL_GPL(acpi_dev_runtime_suspend);
809 */ 797 */
810int acpi_dev_runtime_resume(struct device *dev) 798int acpi_dev_runtime_resume(struct device *dev)
811{ 799{
812 struct acpi_device *adev = acpi_dev_pm_get_node(dev); 800 struct acpi_device *adev = ACPI_COMPANION(dev);
813 int error; 801 int error;
814 802
815 if (!adev) 803 if (!adev)
@@ -862,7 +850,7 @@ EXPORT_SYMBOL_GPL(acpi_subsys_runtime_resume);
862 */ 850 */
863int acpi_dev_suspend_late(struct device *dev) 851int acpi_dev_suspend_late(struct device *dev)
864{ 852{
865 struct acpi_device *adev = acpi_dev_pm_get_node(dev); 853 struct acpi_device *adev = ACPI_COMPANION(dev);
866 u32 target_state; 854 u32 target_state;
867 bool wakeup; 855 bool wakeup;
868 int error; 856 int error;
@@ -894,7 +882,7 @@ EXPORT_SYMBOL_GPL(acpi_dev_suspend_late);
894 */ 882 */
895int acpi_dev_resume_early(struct device *dev) 883int acpi_dev_resume_early(struct device *dev)
896{ 884{
897 struct acpi_device *adev = acpi_dev_pm_get_node(dev); 885 struct acpi_device *adev = ACPI_COMPANION(dev);
898 int error; 886 int error;
899 887
900 if (!adev) 888 if (!adev)
@@ -985,7 +973,7 @@ static struct dev_pm_domain acpi_general_pm_domain = {
985 */ 973 */
986int acpi_dev_pm_attach(struct device *dev, bool power_on) 974int acpi_dev_pm_attach(struct device *dev, bool power_on)
987{ 975{
988 struct acpi_device *adev = acpi_dev_pm_get_node(dev); 976 struct acpi_device *adev = ACPI_COMPANION(dev);
989 977
990 if (!adev) 978 if (!adev)
991 return -ENODEV; 979 return -ENODEV;
@@ -1017,7 +1005,7 @@ EXPORT_SYMBOL_GPL(acpi_dev_pm_attach);
1017 */ 1005 */
1018void acpi_dev_pm_detach(struct device *dev, bool power_off) 1006void acpi_dev_pm_detach(struct device *dev, bool power_off)
1019{ 1007{
1020 struct acpi_device *adev = acpi_dev_pm_get_node(dev); 1008 struct acpi_device *adev = ACPI_COMPANION(dev);
1021 1009
1022 if (adev && dev->pm_domain == &acpi_general_pm_domain) { 1010 if (adev && dev->pm_domain == &acpi_general_pm_domain) {
1023 dev->pm_domain = NULL; 1011 dev->pm_domain = NULL;
diff --git a/drivers/acpi/processor_core.c b/drivers/acpi/processor_core.c
index 34e7b3c6a08d..a4eea9a508d3 100644
--- a/drivers/acpi/processor_core.c
+++ b/drivers/acpi/processor_core.c
@@ -44,13 +44,13 @@ static int map_lapic_id(struct acpi_subtable_header *entry,
44 (struct acpi_madt_local_apic *)entry; 44 (struct acpi_madt_local_apic *)entry;
45 45
46 if (!(lapic->lapic_flags & ACPI_MADT_ENABLED)) 46 if (!(lapic->lapic_flags & ACPI_MADT_ENABLED))
47 return 0; 47 return -ENODEV;
48 48
49 if (lapic->processor_id != acpi_id) 49 if (lapic->processor_id != acpi_id)
50 return 0; 50 return -EINVAL;
51 51
52 *apic_id = lapic->id; 52 *apic_id = lapic->id;
53 return 1; 53 return 0;
54} 54}
55 55
56static int map_x2apic_id(struct acpi_subtable_header *entry, 56static int map_x2apic_id(struct acpi_subtable_header *entry,
@@ -60,14 +60,14 @@ static int map_x2apic_id(struct acpi_subtable_header *entry,
60 (struct acpi_madt_local_x2apic *)entry; 60 (struct acpi_madt_local_x2apic *)entry;
61 61
62 if (!(apic->lapic_flags & ACPI_MADT_ENABLED)) 62 if (!(apic->lapic_flags & ACPI_MADT_ENABLED))
63 return 0; 63 return -ENODEV;
64 64
65 if (device_declaration && (apic->uid == acpi_id)) { 65 if (device_declaration && (apic->uid == acpi_id)) {
66 *apic_id = apic->local_apic_id; 66 *apic_id = apic->local_apic_id;
67 return 1; 67 return 0;
68 } 68 }
69 69
70 return 0; 70 return -EINVAL;
71} 71}
72 72
73static int map_lsapic_id(struct acpi_subtable_header *entry, 73static int map_lsapic_id(struct acpi_subtable_header *entry,
@@ -77,16 +77,16 @@ static int map_lsapic_id(struct acpi_subtable_header *entry,
77 (struct acpi_madt_local_sapic *)entry; 77 (struct acpi_madt_local_sapic *)entry;
78 78
79 if (!(lsapic->lapic_flags & ACPI_MADT_ENABLED)) 79 if (!(lsapic->lapic_flags & ACPI_MADT_ENABLED))
80 return 0; 80 return -ENODEV;
81 81
82 if (device_declaration) { 82 if (device_declaration) {
83 if ((entry->length < 16) || (lsapic->uid != acpi_id)) 83 if ((entry->length < 16) || (lsapic->uid != acpi_id))
84 return 0; 84 return -EINVAL;
85 } else if (lsapic->processor_id != acpi_id) 85 } else if (lsapic->processor_id != acpi_id)
86 return 0; 86 return -EINVAL;
87 87
88 *apic_id = (lsapic->id << 8) | lsapic->eid; 88 *apic_id = (lsapic->id << 8) | lsapic->eid;
89 return 1; 89 return 0;
90} 90}
91 91
92static int map_madt_entry(int type, u32 acpi_id) 92static int map_madt_entry(int type, u32 acpi_id)
@@ -116,13 +116,13 @@ static int map_madt_entry(int type, u32 acpi_id)
116 struct acpi_subtable_header *header = 116 struct acpi_subtable_header *header =
117 (struct acpi_subtable_header *)entry; 117 (struct acpi_subtable_header *)entry;
118 if (header->type == ACPI_MADT_TYPE_LOCAL_APIC) { 118 if (header->type == ACPI_MADT_TYPE_LOCAL_APIC) {
119 if (map_lapic_id(header, acpi_id, &apic_id)) 119 if (!map_lapic_id(header, acpi_id, &apic_id))
120 break; 120 break;
121 } else if (header->type == ACPI_MADT_TYPE_LOCAL_X2APIC) { 121 } else if (header->type == ACPI_MADT_TYPE_LOCAL_X2APIC) {
122 if (map_x2apic_id(header, type, acpi_id, &apic_id)) 122 if (!map_x2apic_id(header, type, acpi_id, &apic_id))
123 break; 123 break;
124 } else if (header->type == ACPI_MADT_TYPE_LOCAL_SAPIC) { 124 } else if (header->type == ACPI_MADT_TYPE_LOCAL_SAPIC) {
125 if (map_lsapic_id(header, type, acpi_id, &apic_id)) 125 if (!map_lsapic_id(header, type, acpi_id, &apic_id))
126 break; 126 break;
127 } 127 }
128 entry += header->length; 128 entry += header->length;
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
index e00365ccb897..7384158c7f87 100644
--- a/drivers/acpi/scan.c
+++ b/drivers/acpi/scan.c
@@ -2105,6 +2105,7 @@ void acpi_bus_trim(struct acpi_device *adev)
2105 list_for_each_entry_reverse(child, &adev->children, node) 2105 list_for_each_entry_reverse(child, &adev->children, node)
2106 acpi_bus_trim(child); 2106 acpi_bus_trim(child);
2107 2107
2108 adev->flags.match_driver = false;
2108 if (handler) { 2109 if (handler) {
2109 if (handler->detach) 2110 if (handler->detach)
2110 handler->detach(adev); 2111 handler->detach(adev);
diff --git a/drivers/acpi/sysfs.c b/drivers/acpi/sysfs.c
index 443dc9366052..91a32cefb11f 100644
--- a/drivers/acpi/sysfs.c
+++ b/drivers/acpi/sysfs.c
@@ -226,7 +226,7 @@ module_param_call(trace_state, param_set_trace_state, param_get_trace_state,
226/* /sys/modules/acpi/parameters/aml_debug_output */ 226/* /sys/modules/acpi/parameters/aml_debug_output */
227 227
228module_param_named(aml_debug_output, acpi_gbl_enable_aml_debug_object, 228module_param_named(aml_debug_output, acpi_gbl_enable_aml_debug_object,
229 bool, 0644); 229 byte, 0644);
230MODULE_PARM_DESC(aml_debug_output, 230MODULE_PARM_DESC(aml_debug_output,
231 "To enable/disable the ACPI Debug Object output."); 231 "To enable/disable the ACPI Debug Object output.");
232 232
diff --git a/drivers/cpufreq/acpi-cpufreq.c b/drivers/cpufreq/acpi-cpufreq.c
index 79e5608e71b5..18448a7e9f86 100644
--- a/drivers/cpufreq/acpi-cpufreq.c
+++ b/drivers/cpufreq/acpi-cpufreq.c
@@ -919,7 +919,7 @@ static void __init acpi_cpufreq_boost_init(void)
919 } 919 }
920} 920}
921 921
922static void __exit acpi_cpufreq_boost_exit(void) 922static void acpi_cpufreq_boost_exit(void)
923{ 923{
924 if (msrs) { 924 if (msrs) {
925 unregister_cpu_notifier(&boost_nb); 925 unregister_cpu_notifier(&boost_nb);
@@ -969,9 +969,10 @@ static int __init acpi_cpufreq_init(void)
969 acpi_cpufreq_boost_init(); 969 acpi_cpufreq_boost_init();
970 970
971 ret = cpufreq_register_driver(&acpi_cpufreq_driver); 971 ret = cpufreq_register_driver(&acpi_cpufreq_driver);
972 if (ret) 972 if (ret) {
973 free_acpi_perf_data(); 973 free_acpi_perf_data();
974 974 acpi_cpufreq_boost_exit();
975 }
975 return ret; 976 return ret;
976} 977}
977 978
diff --git a/drivers/devfreq/Kconfig b/drivers/devfreq/Kconfig
index 31f3adba4cf3..7d2f43550700 100644
--- a/drivers/devfreq/Kconfig
+++ b/drivers/devfreq/Kconfig
@@ -67,7 +67,7 @@ comment "DEVFREQ Drivers"
67 67
68config ARM_EXYNOS4_BUS_DEVFREQ 68config ARM_EXYNOS4_BUS_DEVFREQ
69 bool "ARM Exynos4210/4212/4412 Memory Bus DEVFREQ Driver" 69 bool "ARM Exynos4210/4212/4412 Memory Bus DEVFREQ Driver"
70 depends on CPU_EXYNOS4210 || SOC_EXYNOS4212 || SOC_EXYNOS4412 70 depends on (CPU_EXYNOS4210 || SOC_EXYNOS4212 || SOC_EXYNOS4412) && !ARCH_MULTIPLATFORM
71 select ARCH_HAS_OPP 71 select ARCH_HAS_OPP
72 select DEVFREQ_GOV_SIMPLE_ONDEMAND 72 select DEVFREQ_GOV_SIMPLE_ONDEMAND
73 help 73 help