Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge back earlier 'acpi-processor' material.

+61 -29
-4
arch/ia64/kernel/acpi.c
··· 54 54 #include <asm/sal.h> 55 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 57 #define PREFIX "ACPI: " 62 58 63 59 unsigned int acpi_cpei_override;
-4
arch/x86/kernel/acpi/boot.c
··· 53 53 # include <asm/proto.h> 54 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 56 #define PREFIX "ACPI: " 61 57 62 58 int acpi_noirq; /* skip ACPI IRQ initialization */
+57 -21
drivers/acpi/processor_core.c
··· 19 19 #define _COMPONENT ACPI_PROCESSOR_COMPONENT 20 20 ACPI_MODULE_NAME("processor_core"); 21 21 22 - static 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 - 30 - static 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 - 40 22 static int map_lapic_id(struct acpi_subtable_header *entry, 41 23 u32 acpi_id, int *apic_id) 42 24 { ··· 71 89 return 0; 72 90 } 73 91 92 + static int map_gic_id(struct acpi_subtable_header *entry, 93 + int device_declaration, u32 acpi_id, int *apic_id) 94 + { 95 + struct acpi_madt_generic_interrupt *gic = 96 + (struct acpi_madt_generic_interrupt *)entry; 97 + 98 + if (!(gic->flags & ACPI_MADT_ENABLED)) 99 + return -ENODEV; 100 + 101 + /* 102 + * In the GIC interrupt model, logical processors are 103 + * required to have a Processor Device object in the DSDT, 104 + * so we should check device_declaration here 105 + */ 106 + if (device_declaration && (gic->uid == acpi_id)) { 107 + *apic_id = gic->gic_id; 108 + return 0; 109 + } 110 + 111 + return -EINVAL; 112 + } 113 + 74 114 static int map_madt_entry(int type, u32 acpi_id) 75 115 { 76 116 unsigned long madt_end, entry; ··· 128 124 } else if (header->type == ACPI_MADT_TYPE_LOCAL_SAPIC) { 129 125 if (!map_lsapic_id(header, type, acpi_id, &apic_id)) 130 126 break; 127 + } else if (header->type == ACPI_MADT_TYPE_GENERIC_INTERRUPT) { 128 + if (!map_gic_id(header, type, acpi_id, &apic_id)) 129 + break; 131 130 } 132 131 entry += header->length; 133 132 } ··· 161 154 map_lapic_id(header, acpi_id, &apic_id); 162 155 } else if (header->type == ACPI_MADT_TYPE_LOCAL_SAPIC) { 163 156 map_lsapic_id(header, type, acpi_id, &apic_id); 157 + } else if (header->type == ACPI_MADT_TYPE_GENERIC_INTERRUPT) { 158 + map_gic_id(header, type, acpi_id, &apic_id); 164 159 } 165 160 166 161 exit: ··· 332 323 * _PDC is required for a BIOS-OS handshake for most of the newer 333 324 * ACPI processor features. 334 325 */ 335 - static int 326 + static acpi_status 336 327 acpi_processor_eval_pdc(acpi_handle handle, struct acpi_object_list *pdc_in) 337 328 { 338 329 acpi_status status = AE_OK; ··· 388 379 return AE_OK; 389 380 } 390 381 391 - void __init acpi_early_processor_set_pdc(void) 382 + #if defined(CONFIG_X86) || defined(CONFIG_IA64) 383 + static int __init set_no_mwait(const struct dmi_system_id *id) 384 + { 385 + pr_notice(PREFIX "%s detected - disabling mwait for CPU C-states\n", 386 + id->ident); 387 + boot_option_idle_override = IDLE_NOMWAIT; 388 + return 0; 389 + } 390 + 391 + static struct dmi_system_id processor_idle_dmi_table[] __initdata = { 392 + { 393 + set_no_mwait, "Extensa 5220", { 394 + DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies LTD"), 395 + DMI_MATCH(DMI_SYS_VENDOR, "Acer"), 396 + DMI_MATCH(DMI_PRODUCT_VERSION, "0100"), 397 + DMI_MATCH(DMI_BOARD_NAME, "Columbia") }, NULL}, 398 + {}, 399 + }; 400 + 401 + static void __init processor_dmi_check(void) 392 402 { 393 403 /* 394 404 * Check whether the system is DMI table. If yes, OSPM 395 405 * should not use mwait for CPU-states. 396 406 */ 397 407 dmi_check_system(processor_idle_dmi_table); 408 + } 409 + #else 410 + static inline void processor_dmi_check(void) {} 411 + #endif 412 + 413 + void __init acpi_early_processor_set_pdc(void) 414 + { 415 + processor_dmi_check(); 398 416 399 417 acpi_walk_namespace(ACPI_TYPE_PROCESSOR, ACPI_ROOT_OBJECT, 400 418 ACPI_UINT32_MAX, 401 419 early_init_pdc, NULL, NULL, NULL); 402 - acpi_get_devices("ACPI0007", early_init_pdc, NULL, NULL); 420 + acpi_get_devices(ACPI_PROCESSOR_DEVICE_HID, early_init_pdc, NULL, NULL); 403 421 }
+4
include/linux/acpi.h
··· 108 108 } 109 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 + 111 115 char * __acpi_map_table (unsigned long phys_addr, unsigned long size); 112 116 void __acpi_unmap_table(char *map, unsigned long size); 113 117 int early_acpi_boot_init(void);