aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2014-02-26 18:22:42 -0500
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2014-02-26 18:22:42 -0500
commit38953d3945aedf8e198b75ff09b22e369f14566f (patch)
tree03a8b7401184e15f1edccbe40624ad1fd1835a49
parentf3ca4164529b875374c410193bbbac0ee960895f (diff)
parent328281b1cda4dfef5b86c255b0aba8a8a96e0dad (diff)
Merge back earlier 'acpi-processor' material.
-rw-r--r--arch/ia64/kernel/acpi.c4
-rw-r--r--arch/x86/kernel/acpi/boot.c4
-rw-r--r--drivers/acpi/processor_core.c78
-rw-r--r--include/linux/acpi.h4
4 files changed, 61 insertions, 29 deletions
diff --git a/arch/ia64/kernel/acpi.c b/arch/ia64/kernel/acpi.c
index 07d209c9507f..467497ade45f 100644
--- a/arch/ia64/kernel/acpi.c
+++ b/arch/ia64/kernel/acpi.c
@@ -54,10 +54,6 @@
54#include <asm/sal.h> 54#include <asm/sal.h>
55#include <asm/cyclone.h> 55#include <asm/cyclone.h>
56 56
57#define BAD_MADT_ENTRY(entry, end) ( \
58 (!entry) || (unsigned long)entry + sizeof(*entry) > end || \
59 ((struct acpi_subtable_header *)entry)->length < sizeof(*entry))
60
61#define PREFIX "ACPI: " 57#define PREFIX "ACPI: "
62 58
63unsigned int acpi_cpei_override; 59unsigned int acpi_cpei_override;
diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c
index 1dac94265b59..123f9e37eee4 100644
--- a/arch/x86/kernel/acpi/boot.c
+++ b/arch/x86/kernel/acpi/boot.c
@@ -53,10 +53,6 @@ EXPORT_SYMBOL(acpi_disabled);
53# include <asm/proto.h> 53# include <asm/proto.h>
54#endif /* X86 */ 54#endif /* X86 */
55 55
56#define BAD_MADT_ENTRY(entry, end) ( \
57 (!entry) || (unsigned long)entry + sizeof(*entry) > end || \
58 ((struct acpi_subtable_header *)entry)->length < sizeof(*entry))
59
60#define PREFIX "ACPI: " 56#define PREFIX "ACPI: "
61 57
62int acpi_noirq; /* skip ACPI IRQ initialization */ 58int acpi_noirq; /* skip ACPI IRQ initialization */
diff --git a/drivers/acpi/processor_core.c b/drivers/acpi/processor_core.c
index a4eea9a508d3..f1dd404463aa 100644
--- a/drivers/acpi/processor_core.c
+++ b/drivers/acpi/processor_core.c
@@ -19,24 +19,6 @@
19#define _COMPONENT ACPI_PROCESSOR_COMPONENT 19#define _COMPONENT ACPI_PROCESSOR_COMPONENT
20ACPI_MODULE_NAME("processor_core"); 20ACPI_MODULE_NAME("processor_core");
21 21
22static int __init set_no_mwait(const struct dmi_system_id *id)
23{
24 printk(KERN_NOTICE PREFIX "%s detected - "
25 "disabling mwait for CPU C-states\n", id->ident);
26 boot_option_idle_override = IDLE_NOMWAIT;
27 return 0;
28}
29
30static struct dmi_system_id processor_idle_dmi_table[] __initdata = {
31 {
32 set_no_mwait, "Extensa 5220", {
33 DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies LTD"),
34 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
35 DMI_MATCH(DMI_PRODUCT_VERSION, "0100"),
36 DMI_MATCH(DMI_BOARD_NAME, "Columbia") }, NULL},
37 {},
38};
39
40static int map_lapic_id(struct acpi_subtable_header *entry, 22static int map_lapic_id(struct acpi_subtable_header *entry,
41 u32 acpi_id, int *apic_id) 23 u32 acpi_id, int *apic_id)
42{ 24{
@@ -89,6 +71,28 @@ static int map_lsapic_id(struct acpi_subtable_header *entry,
89 return 0; 71 return 0;
90} 72}
91 73
74static int map_gic_id(struct acpi_subtable_header *entry,
75 int device_declaration, u32 acpi_id, int *apic_id)
76{
77 struct acpi_madt_generic_interrupt *gic =
78 (struct acpi_madt_generic_interrupt *)entry;
79
80 if (!(gic->flags & ACPI_MADT_ENABLED))
81 return -ENODEV;
82
83 /*
84 * In the GIC interrupt model, logical processors are
85 * required to have a Processor Device object in the DSDT,
86 * so we should check device_declaration here
87 */
88 if (device_declaration && (gic->uid == acpi_id)) {
89 *apic_id = gic->gic_id;
90 return 0;
91 }
92
93 return -EINVAL;
94}
95
92static int map_madt_entry(int type, u32 acpi_id) 96static int map_madt_entry(int type, u32 acpi_id)
93{ 97{
94 unsigned long madt_end, entry; 98 unsigned long madt_end, entry;
@@ -124,6 +128,9 @@ static int map_madt_entry(int type, u32 acpi_id)
124 } else if (header->type == ACPI_MADT_TYPE_LOCAL_SAPIC) { 128 } else if (header->type == ACPI_MADT_TYPE_LOCAL_SAPIC) {
125 if (!map_lsapic_id(header, type, acpi_id, &apic_id)) 129 if (!map_lsapic_id(header, type, acpi_id, &apic_id))
126 break; 130 break;
131 } else if (header->type == ACPI_MADT_TYPE_GENERIC_INTERRUPT) {
132 if (!map_gic_id(header, type, acpi_id, &apic_id))
133 break;
127 } 134 }
128 entry += header->length; 135 entry += header->length;
129 } 136 }
@@ -154,6 +161,8 @@ static int map_mat_entry(acpi_handle handle, int type, u32 acpi_id)
154 map_lapic_id(header, acpi_id, &apic_id); 161 map_lapic_id(header, acpi_id, &apic_id);
155 } else if (header->type == ACPI_MADT_TYPE_LOCAL_SAPIC) { 162 } else if (header->type == ACPI_MADT_TYPE_LOCAL_SAPIC) {
156 map_lsapic_id(header, type, acpi_id, &apic_id); 163 map_lsapic_id(header, type, acpi_id, &apic_id);
164 } else if (header->type == ACPI_MADT_TYPE_GENERIC_INTERRUPT) {
165 map_gic_id(header, type, acpi_id, &apic_id);
157 } 166 }
158 167
159exit: 168exit:
@@ -323,7 +332,7 @@ static struct acpi_object_list *acpi_processor_alloc_pdc(void)
323 * _PDC is required for a BIOS-OS handshake for most of the newer 332 * _PDC is required for a BIOS-OS handshake for most of the newer
324 * ACPI processor features. 333 * ACPI processor features.
325 */ 334 */
326static int 335static acpi_status
327acpi_processor_eval_pdc(acpi_handle handle, struct acpi_object_list *pdc_in) 336acpi_processor_eval_pdc(acpi_handle handle, struct acpi_object_list *pdc_in)
328{ 337{
329 acpi_status status = AE_OK; 338 acpi_status status = AE_OK;
@@ -379,16 +388,43 @@ early_init_pdc(acpi_handle handle, u32 lvl, void *context, void **rv)
379 return AE_OK; 388 return AE_OK;
380} 389}
381 390
382void __init acpi_early_processor_set_pdc(void) 391#if defined(CONFIG_X86) || defined(CONFIG_IA64)
392static int __init set_no_mwait(const struct dmi_system_id *id)
393{
394 pr_notice(PREFIX "%s detected - disabling mwait for CPU C-states\n",
395 id->ident);
396 boot_option_idle_override = IDLE_NOMWAIT;
397 return 0;
398}
399
400static struct dmi_system_id processor_idle_dmi_table[] __initdata = {
401 {
402 set_no_mwait, "Extensa 5220", {
403 DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies LTD"),
404 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
405 DMI_MATCH(DMI_PRODUCT_VERSION, "0100"),
406 DMI_MATCH(DMI_BOARD_NAME, "Columbia") }, NULL},
407 {},
408};
409
410static void __init processor_dmi_check(void)
383{ 411{
384 /* 412 /*
385 * Check whether the system is DMI table. If yes, OSPM 413 * Check whether the system is DMI table. If yes, OSPM
386 * should not use mwait for CPU-states. 414 * should not use mwait for CPU-states.
387 */ 415 */
388 dmi_check_system(processor_idle_dmi_table); 416 dmi_check_system(processor_idle_dmi_table);
417}
418#else
419static inline void processor_dmi_check(void) {}
420#endif
421
422void __init acpi_early_processor_set_pdc(void)
423{
424 processor_dmi_check();
389 425
390 acpi_walk_namespace(ACPI_TYPE_PROCESSOR, ACPI_ROOT_OBJECT, 426 acpi_walk_namespace(ACPI_TYPE_PROCESSOR, ACPI_ROOT_OBJECT,
391 ACPI_UINT32_MAX, 427 ACPI_UINT32_MAX,
392 early_init_pdc, NULL, NULL, NULL); 428 early_init_pdc, NULL, NULL, NULL);
393 acpi_get_devices("ACPI0007", early_init_pdc, NULL, NULL); 429 acpi_get_devices(ACPI_PROCESSOR_DEVICE_HID, early_init_pdc, NULL, NULL);
394} 430}
diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index 1151a1dcfe41..6a15dddbaa09 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -108,6 +108,10 @@ static inline void acpi_initrd_override(void *data, size_t size)
108} 108}
109#endif 109#endif
110 110
111#define BAD_MADT_ENTRY(entry, end) ( \
112 (!entry) || (unsigned long)entry + sizeof(*entry) > end || \
113 ((struct acpi_subtable_header *)entry)->length < sizeof(*entry))
114
111char * __acpi_map_table (unsigned long phys_addr, unsigned long size); 115char * __acpi_map_table (unsigned long phys_addr, unsigned long size);
112void __acpi_unmap_table(char *map, unsigned long size); 116void __acpi_unmap_table(char *map, unsigned long size);
113int early_acpi_boot_init(void); 117int early_acpi_boot_init(void);