aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/tables.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-04-01 15:48:54 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-04-01 15:48:54 -0400
commit4dedde7c7a18f55180574f934dbc1be84ca0400b (patch)
treed7cc511e8ba8ffceadf3f45b9a63395c4e4183c5 /drivers/acpi/tables.c
parent683b6c6f82a60fabf47012581c2cfbf1b037ab95 (diff)
parent0ecfe310f4517d7505599be738158087c165be7c (diff)
Merge tag 'pm+acpi-3.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull ACPI and power management updates from Rafael Wysocki: "The majority of this material spent some time in linux-next, some of it even several weeks. There are a few relatively fresh commits in it, but they are mostly fixes and simple cleanups. ACPI took the lead this time, both in terms of the number of commits and the number of modified lines of code, cpufreq follows and there are a few changes in the PM core and in cpuidle too. A new feature that already got some LWN.net's attention is the device PM QoS extension allowing latency tolerance requirements to be propagated from leaf devices to their ancestors with hardware interfaces for specifying latency tolerance. That should help systems with hardware-driven power management to avoid going too far with it in cases when there are latency tolerance constraints. There also are some significant changes in the ACPI core related to the way in which hotplug notifications are handled. They affect PCI hotplug (ACPIPHP) and the ACPI dock station code too. The bottom line is that all those notification now go through the root notify handler and are propagated to the interested subsystems by means of callbacks instead of having to install a notify handler for each device object that we can potentially get hotplug notifications for. In addition to that ACPICA will now advertise "Windows 2013" compatibility for _OSI, because some systems out there don't work correctly if that is not done (some of them don't even boot). On the system suspend side of things, all of the device suspend and resume callbacks, except for ->prepare() and ->complete(), are now going to be executed asynchronously as that turns out to speed up system suspend and resume on some platforms quite significantly and we have a few more optimizations in that area. Apart from that, there are some new device IDs and fixes and cleanups all over. In particular, the system suspend and resume handling by cpufreq should be improved and the cpuidle menu governor should be a bit more robust now. Specifics: - Device PM QoS support for latency tolerance constraints on systems with hardware interfaces allowing such constraints to be specified. That is necessary to prevent hardware-driven power management from becoming overly aggressive on some systems and to prevent power management features leading to excessive latencies from being used in some cases. - Consolidation of the handling of ACPI hotplug notifications for device objects. This causes all device hotplug notifications to go through the root notify handler (that was executed for all of them anyway before) that propagates them to individual subsystems, if necessary, by executing callbacks provided by those subsystems (those callbacks are associated with struct acpi_device objects during device enumeration). As a result, the code in question becomes both smaller in size and more straightforward and all of those changes should not affect users. - ACPICA update, including fixes related to the handling of _PRT in cases when it is broken and the addition of "Windows 2013" to the list of supported "features" for _OSI (which is necessary to support systems that work incorrectly or don't even boot without it). Changes from Bob Moore and Lv Zheng. - Consolidation of ACPI _OST handling from Jiang Liu. - ACPI battery and AC fixes allowing unusual system configurations to be handled by that code from Alexander Mezin. - New device IDs for the ACPI LPSS driver from Chiau Ee Chew. - ACPI fan and thermal optimizations related to system suspend and resume from Aaron Lu. - Cleanups related to ACPI video from Jean Delvare. - Assorted ACPI fixes and cleanups from Al Stone, Hanjun Guo, Lan Tianyu, Paul Bolle, Tomasz Nowicki. - Intel RAPL (Running Average Power Limits) driver cleanups from Jacob Pan. - intel_pstate fixes and cleanups from Dirk Brandewie. - cpufreq fixes related to system suspend/resume handling from Viresh Kumar. - cpufreq core fixes and cleanups from Viresh Kumar, Stratos Karafotis, Saravana Kannan, Rashika Kheria, Joe Perches. - cpufreq drivers updates from Viresh Kumar, Zhuoyu Zhang, Rob Herring. - cpuidle fixes related to the menu governor from Tuukka Tikkanen. - cpuidle fix related to coupled CPUs handling from Paul Burton. - Asynchronous execution of all device suspend and resume callbacks, except for ->prepare and ->complete, during system suspend and resume from Chuansheng Liu. - Delayed resuming of runtime-suspended devices during system suspend for the PCI bus type and ACPI PM domain. - New set of PM helper routines to allow device runtime PM callbacks to be used during system suspend and resume more easily from Ulf Hansson. - Assorted fixes and cleanups in the PM core from Geert Uytterhoeven, Prabhakar Lad, Philipp Zabel, Rashika Kheria, Sebastian Capella. - devfreq fix from Saravana Kannan" * tag 'pm+acpi-3.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (162 commits) PM / devfreq: Rewrite devfreq_update_status() to fix multiple bugs PM / sleep: Correct whitespace errors in <linux/pm.h> intel_pstate: Set core to min P state during core offline cpufreq: Add stop CPU callback to cpufreq_driver interface cpufreq: Remove unnecessary braces cpufreq: Fix checkpatch errors and warnings cpufreq: powerpc: add cpufreq transition latency for FSL e500mc SoCs MAINTAINERS: Reorder maintainer addresses for PM and ACPI PM / Runtime: Update runtime_idle() documentation for return value meaning video / output: Drop display output class support fujitsu-laptop: Drop unneeded include acer-wmi: Stop selecting VIDEO_OUTPUT_CONTROL ACPI / gpu / drm: Stop selecting VIDEO_OUTPUT_CONTROL ACPI / video: fix ACPI_VIDEO dependencies cpufreq: remove unused notifier: CPUFREQ_{SUSPENDCHANGE|RESUMECHANGE} cpufreq: Do not allow ->setpolicy drivers to provide ->target cpufreq: arm_big_little: set 'physical_cluster' for each CPU cpufreq: arm_big_little: make vexpress driver depend on bL core driver ACPI / button: Add ACPI Button event via netlink routine ACPI: Remove duplicate definitions of PREFIX ...
Diffstat (limited to 'drivers/acpi/tables.c')
-rw-r--r--drivers/acpi/tables.c128
1 files changed, 55 insertions, 73 deletions
diff --git a/drivers/acpi/tables.c b/drivers/acpi/tables.c
index 5837f857ac2e..21782290df41 100644
--- a/drivers/acpi/tables.c
+++ b/drivers/acpi/tables.c
@@ -23,6 +23,8 @@
23 * 23 *
24 */ 24 */
25 25
26#define pr_fmt(fmt) "ACPI: " fmt
27
26#include <linux/init.h> 28#include <linux/init.h>
27#include <linux/kernel.h> 29#include <linux/kernel.h>
28#include <linux/smp.h> 30#include <linux/smp.h>
@@ -33,8 +35,6 @@
33#include <linux/acpi.h> 35#include <linux/acpi.h>
34#include <linux/bootmem.h> 36#include <linux/bootmem.h>
35 37
36#define PREFIX "ACPI: "
37
38#define ACPI_MAX_TABLES 128 38#define ACPI_MAX_TABLES 128
39 39
40static char *mps_inti_flags_polarity[] = { "dfl", "high", "res", "low" }; 40static char *mps_inti_flags_polarity[] = { "dfl", "high", "res", "low" };
@@ -55,10 +55,9 @@ void acpi_table_print_madt_entry(struct acpi_subtable_header *header)
55 { 55 {
56 struct acpi_madt_local_apic *p = 56 struct acpi_madt_local_apic *p =
57 (struct acpi_madt_local_apic *)header; 57 (struct acpi_madt_local_apic *)header;
58 printk(KERN_INFO PREFIX 58 pr_info("LAPIC (acpi_id[0x%02x] lapic_id[0x%02x] %s)\n",
59 "LAPIC (acpi_id[0x%02x] lapic_id[0x%02x] %s)\n", 59 p->processor_id, p->id,
60 p->processor_id, p->id, 60 (p->lapic_flags & ACPI_MADT_ENABLED) ? "enabled" : "disabled");
61 (p->lapic_flags & ACPI_MADT_ENABLED) ? "enabled" : "disabled");
62 } 61 }
63 break; 62 break;
64 63
@@ -66,11 +65,9 @@ void acpi_table_print_madt_entry(struct acpi_subtable_header *header)
66 { 65 {
67 struct acpi_madt_local_x2apic *p = 66 struct acpi_madt_local_x2apic *p =
68 (struct acpi_madt_local_x2apic *)header; 67 (struct acpi_madt_local_x2apic *)header;
69 printk(KERN_INFO PREFIX 68 pr_info("X2APIC (apic_id[0x%02x] uid[0x%02x] %s)\n",
70 "X2APIC (apic_id[0x%02x] uid[0x%02x] %s)\n", 69 p->local_apic_id, p->uid,
71 p->local_apic_id, p->uid, 70 (p->lapic_flags & ACPI_MADT_ENABLED) ? "enabled" : "disabled");
72 (p->lapic_flags & ACPI_MADT_ENABLED) ?
73 "enabled" : "disabled");
74 } 71 }
75 break; 72 break;
76 73
@@ -78,9 +75,8 @@ void acpi_table_print_madt_entry(struct acpi_subtable_header *header)
78 { 75 {
79 struct acpi_madt_io_apic *p = 76 struct acpi_madt_io_apic *p =
80 (struct acpi_madt_io_apic *)header; 77 (struct acpi_madt_io_apic *)header;
81 printk(KERN_INFO PREFIX 78 pr_info("IOAPIC (id[0x%02x] address[0x%08x] gsi_base[%d])\n",
82 "IOAPIC (id[0x%02x] address[0x%08x] gsi_base[%d])\n", 79 p->id, p->address, p->global_irq_base);
83 p->id, p->address, p->global_irq_base);
84 } 80 }
85 break; 81 break;
86 82
@@ -88,18 +84,15 @@ void acpi_table_print_madt_entry(struct acpi_subtable_header *header)
88 { 84 {
89 struct acpi_madt_interrupt_override *p = 85 struct acpi_madt_interrupt_override *p =
90 (struct acpi_madt_interrupt_override *)header; 86 (struct acpi_madt_interrupt_override *)header;
91 printk(KERN_INFO PREFIX 87 pr_info("INT_SRC_OVR (bus %d bus_irq %d global_irq %d %s %s)\n",
92 "INT_SRC_OVR (bus %d bus_irq %d global_irq %d %s %s)\n", 88 p->bus, p->source_irq, p->global_irq,
93 p->bus, p->source_irq, p->global_irq, 89 mps_inti_flags_polarity[p->inti_flags & ACPI_MADT_POLARITY_MASK],
94 mps_inti_flags_polarity[p->inti_flags & ACPI_MADT_POLARITY_MASK], 90 mps_inti_flags_trigger[(p->inti_flags & ACPI_MADT_TRIGGER_MASK) >> 2]);
95 mps_inti_flags_trigger[(p->inti_flags & ACPI_MADT_TRIGGER_MASK) >> 2]);
96 if (p->inti_flags & 91 if (p->inti_flags &
97 ~(ACPI_MADT_POLARITY_MASK | ACPI_MADT_TRIGGER_MASK)) 92 ~(ACPI_MADT_POLARITY_MASK | ACPI_MADT_TRIGGER_MASK))
98 printk(KERN_INFO PREFIX 93 pr_info("INT_SRC_OVR unexpected reserved flags: 0x%x\n",
99 "INT_SRC_OVR unexpected reserved flags: 0x%x\n", 94 p->inti_flags &
100 p->inti_flags &
101 ~(ACPI_MADT_POLARITY_MASK | ACPI_MADT_TRIGGER_MASK)); 95 ~(ACPI_MADT_POLARITY_MASK | ACPI_MADT_TRIGGER_MASK));
102
103 } 96 }
104 break; 97 break;
105 98
@@ -107,11 +100,10 @@ void acpi_table_print_madt_entry(struct acpi_subtable_header *header)
107 { 100 {
108 struct acpi_madt_nmi_source *p = 101 struct acpi_madt_nmi_source *p =
109 (struct acpi_madt_nmi_source *)header; 102 (struct acpi_madt_nmi_source *)header;
110 printk(KERN_INFO PREFIX 103 pr_info("NMI_SRC (%s %s global_irq %d)\n",
111 "NMI_SRC (%s %s global_irq %d)\n", 104 mps_inti_flags_polarity[p->inti_flags & ACPI_MADT_POLARITY_MASK],
112 mps_inti_flags_polarity[p->inti_flags & ACPI_MADT_POLARITY_MASK], 105 mps_inti_flags_trigger[(p->inti_flags & ACPI_MADT_TRIGGER_MASK) >> 2],
113 mps_inti_flags_trigger[(p->inti_flags & ACPI_MADT_TRIGGER_MASK) >> 2], 106 p->global_irq);
114 p->global_irq);
115 } 107 }
116 break; 108 break;
117 109
@@ -119,12 +111,11 @@ void acpi_table_print_madt_entry(struct acpi_subtable_header *header)
119 { 111 {
120 struct acpi_madt_local_apic_nmi *p = 112 struct acpi_madt_local_apic_nmi *p =
121 (struct acpi_madt_local_apic_nmi *)header; 113 (struct acpi_madt_local_apic_nmi *)header;
122 printk(KERN_INFO PREFIX 114 pr_info("LAPIC_NMI (acpi_id[0x%02x] %s %s lint[0x%x])\n",
123 "LAPIC_NMI (acpi_id[0x%02x] %s %s lint[0x%x])\n", 115 p->processor_id,
124 p->processor_id, 116 mps_inti_flags_polarity[p->inti_flags & ACPI_MADT_POLARITY_MASK ],
125 mps_inti_flags_polarity[p->inti_flags & ACPI_MADT_POLARITY_MASK ], 117 mps_inti_flags_trigger[(p->inti_flags & ACPI_MADT_TRIGGER_MASK) >> 2],
126 mps_inti_flags_trigger[(p->inti_flags & ACPI_MADT_TRIGGER_MASK) >> 2], 118 p->lint);
127 p->lint);
128 } 119 }
129 break; 120 break;
130 121
@@ -137,12 +128,11 @@ void acpi_table_print_madt_entry(struct acpi_subtable_header *header)
137 polarity = p->inti_flags & ACPI_MADT_POLARITY_MASK; 128 polarity = p->inti_flags & ACPI_MADT_POLARITY_MASK;
138 trigger = (p->inti_flags & ACPI_MADT_TRIGGER_MASK) >> 2; 129 trigger = (p->inti_flags & ACPI_MADT_TRIGGER_MASK) >> 2;
139 130
140 printk(KERN_INFO PREFIX 131 pr_info("X2APIC_NMI (uid[0x%02x] %s %s lint[0x%x])\n",
141 "X2APIC_NMI (uid[0x%02x] %s %s lint[0x%x])\n", 132 p->uid,
142 p->uid, 133 mps_inti_flags_polarity[polarity],
143 mps_inti_flags_polarity[polarity], 134 mps_inti_flags_trigger[trigger],
144 mps_inti_flags_trigger[trigger], 135 p->lint);
145 p->lint);
146 } 136 }
147 break; 137 break;
148 138
@@ -150,9 +140,8 @@ void acpi_table_print_madt_entry(struct acpi_subtable_header *header)
150 { 140 {
151 struct acpi_madt_local_apic_override *p = 141 struct acpi_madt_local_apic_override *p =
152 (struct acpi_madt_local_apic_override *)header; 142 (struct acpi_madt_local_apic_override *)header;
153 printk(KERN_INFO PREFIX 143 pr_info("LAPIC_ADDR_OVR (address[%p])\n",
154 "LAPIC_ADDR_OVR (address[%p])\n", 144 (void *)(unsigned long)p->address);
155 (void *)(unsigned long)p->address);
156 } 145 }
157 break; 146 break;
158 147
@@ -160,10 +149,9 @@ void acpi_table_print_madt_entry(struct acpi_subtable_header *header)
160 { 149 {
161 struct acpi_madt_io_sapic *p = 150 struct acpi_madt_io_sapic *p =
162 (struct acpi_madt_io_sapic *)header; 151 (struct acpi_madt_io_sapic *)header;
163 printk(KERN_INFO PREFIX 152 pr_info("IOSAPIC (id[0x%x] address[%p] gsi_base[%d])\n",
164 "IOSAPIC (id[0x%x] address[%p] gsi_base[%d])\n", 153 p->id, (void *)(unsigned long)p->address,
165 p->id, (void *)(unsigned long)p->address, 154 p->global_irq_base);
166 p->global_irq_base);
167 } 155 }
168 break; 156 break;
169 157
@@ -171,10 +159,9 @@ void acpi_table_print_madt_entry(struct acpi_subtable_header *header)
171 { 159 {
172 struct acpi_madt_local_sapic *p = 160 struct acpi_madt_local_sapic *p =
173 (struct acpi_madt_local_sapic *)header; 161 (struct acpi_madt_local_sapic *)header;
174 printk(KERN_INFO PREFIX 162 pr_info("LSAPIC (acpi_id[0x%02x] lsapic_id[0x%02x] lsapic_eid[0x%02x] %s)\n",
175 "LSAPIC (acpi_id[0x%02x] lsapic_id[0x%02x] lsapic_eid[0x%02x] %s)\n", 163 p->processor_id, p->id, p->eid,
176 p->processor_id, p->id, p->eid, 164 (p->lapic_flags & ACPI_MADT_ENABLED) ? "enabled" : "disabled");
177 (p->lapic_flags & ACPI_MADT_ENABLED) ? "enabled" : "disabled");
178 } 165 }
179 break; 166 break;
180 167
@@ -182,19 +169,17 @@ void acpi_table_print_madt_entry(struct acpi_subtable_header *header)
182 { 169 {
183 struct acpi_madt_interrupt_source *p = 170 struct acpi_madt_interrupt_source *p =
184 (struct acpi_madt_interrupt_source *)header; 171 (struct acpi_madt_interrupt_source *)header;
185 printk(KERN_INFO PREFIX 172 pr_info("PLAT_INT_SRC (%s %s type[0x%x] id[0x%04x] eid[0x%x] iosapic_vector[0x%x] global_irq[0x%x]\n",
186 "PLAT_INT_SRC (%s %s type[0x%x] id[0x%04x] eid[0x%x] iosapic_vector[0x%x] global_irq[0x%x]\n", 173 mps_inti_flags_polarity[p->inti_flags & ACPI_MADT_POLARITY_MASK],
187 mps_inti_flags_polarity[p->inti_flags & ACPI_MADT_POLARITY_MASK], 174 mps_inti_flags_trigger[(p->inti_flags & ACPI_MADT_TRIGGER_MASK) >> 2],
188 mps_inti_flags_trigger[(p->inti_flags & ACPI_MADT_TRIGGER_MASK) >> 2], 175 p->type, p->id, p->eid, p->io_sapic_vector,
189 p->type, p->id, p->eid, p->io_sapic_vector, 176 p->global_irq);
190 p->global_irq);
191 } 177 }
192 break; 178 break;
193 179
194 default: 180 default:
195 printk(KERN_WARNING PREFIX 181 pr_warn("Found unsupported MADT entry (type = 0x%x)\n",
196 "Found unsupported MADT entry (type = 0x%x)\n", 182 header->type);
197 header->type);
198 break; 183 break;
199 } 184 }
200} 185}
@@ -225,7 +210,7 @@ acpi_table_parse_entries(char *id,
225 acpi_get_table_with_size(id, 0, &table_header, &tbl_size); 210 acpi_get_table_with_size(id, 0, &table_header, &tbl_size);
226 211
227 if (!table_header) { 212 if (!table_header) {
228 printk(KERN_WARNING PREFIX "%4.4s not present\n", id); 213 pr_warn("%4.4s not present\n", id);
229 return -ENODEV; 214 return -ENODEV;
230 } 215 }
231 216
@@ -248,7 +233,7 @@ acpi_table_parse_entries(char *id,
248 * infinite loop. 233 * infinite loop.
249 */ 234 */
250 if (entry->length == 0) { 235 if (entry->length == 0) {
251 pr_err(PREFIX "[%4.4s:0x%02x] Invalid zero length\n", id, entry_id); 236 pr_err("[%4.4s:0x%02x] Invalid zero length\n", id, entry_id);
252 goto err; 237 goto err;
253 } 238 }
254 239
@@ -256,8 +241,8 @@ acpi_table_parse_entries(char *id,
256 ((unsigned long)entry + entry->length); 241 ((unsigned long)entry + entry->length);
257 } 242 }
258 if (max_entries && count > max_entries) { 243 if (max_entries && count > max_entries) {
259 printk(KERN_WARNING PREFIX "[%4.4s:0x%02x] ignored %i entries of " 244 pr_warn("[%4.4s:0x%02x] ignored %i entries of %i found\n",
260 "%i found\n", id, entry_id, count - max_entries, count); 245 id, entry_id, count - max_entries, count);
261 } 246 }
262 247
263 early_acpi_os_unmap_memory((char *)table_header, tbl_size); 248 early_acpi_os_unmap_memory((char *)table_header, tbl_size);
@@ -322,13 +307,11 @@ static void __init check_multiple_madt(void)
322 307
323 acpi_get_table_with_size(ACPI_SIG_MADT, 2, &table, &tbl_size); 308 acpi_get_table_with_size(ACPI_SIG_MADT, 2, &table, &tbl_size);
324 if (table) { 309 if (table) {
325 printk(KERN_WARNING PREFIX 310 pr_warn("BIOS bug: multiple APIC/MADT found, using %d\n",
326 "BIOS bug: multiple APIC/MADT found," 311 acpi_apic_instance);
327 " using %d\n", acpi_apic_instance); 312 pr_warn("If \"acpi_apic_instance=%d\" works better, "
328 printk(KERN_WARNING PREFIX 313 "notify linux-acpi@vger.kernel.org\n",
329 "If \"acpi_apic_instance=%d\" works better, " 314 acpi_apic_instance ? 0 : 2);
330 "notify linux-acpi@vger.kernel.org\n",
331 acpi_apic_instance ? 0 : 2);
332 early_acpi_os_unmap_memory(table, tbl_size); 315 early_acpi_os_unmap_memory(table, tbl_size);
333 316
334 } else 317 } else
@@ -365,8 +348,7 @@ static int __init acpi_parse_apic_instance(char *str)
365 348
366 acpi_apic_instance = simple_strtoul(str, NULL, 0); 349 acpi_apic_instance = simple_strtoul(str, NULL, 0);
367 350
368 printk(KERN_NOTICE PREFIX "Shall use APIC/MADT table %d\n", 351 pr_notice("Shall use APIC/MADT table %d\n", acpi_apic_instance);
369 acpi_apic_instance);
370 352
371 return 0; 353 return 0;
372} 354}