diff options
Diffstat (limited to 'drivers/acpi/acpi_processor.c')
-rw-r--r-- | drivers/acpi/acpi_processor.c | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/drivers/acpi/acpi_processor.c b/drivers/acpi/acpi_processor.c index b5e54f2da53d..0d92d0f915e9 100644 --- a/drivers/acpi/acpi_processor.c +++ b/drivers/acpi/acpi_processor.c | |||
@@ -491,6 +491,58 @@ static void acpi_processor_remove(struct acpi_device *device) | |||
491 | } | 491 | } |
492 | #endif /* CONFIG_ACPI_HOTPLUG_CPU */ | 492 | #endif /* CONFIG_ACPI_HOTPLUG_CPU */ |
493 | 493 | ||
494 | #ifdef CONFIG_X86 | ||
495 | static bool acpi_hwp_native_thermal_lvt_set; | ||
496 | static acpi_status __init acpi_hwp_native_thermal_lvt_osc(acpi_handle handle, | ||
497 | u32 lvl, | ||
498 | void *context, | ||
499 | void **rv) | ||
500 | { | ||
501 | u8 sb_uuid_str[] = "4077A616-290C-47BE-9EBD-D87058713953"; | ||
502 | u32 capbuf[2]; | ||
503 | struct acpi_osc_context osc_context = { | ||
504 | .uuid_str = sb_uuid_str, | ||
505 | .rev = 1, | ||
506 | .cap.length = 8, | ||
507 | .cap.pointer = capbuf, | ||
508 | }; | ||
509 | |||
510 | if (acpi_hwp_native_thermal_lvt_set) | ||
511 | return AE_CTRL_TERMINATE; | ||
512 | |||
513 | capbuf[0] = 0x0000; | ||
514 | capbuf[1] = 0x1000; /* set bit 12 */ | ||
515 | |||
516 | if (ACPI_SUCCESS(acpi_run_osc(handle, &osc_context))) { | ||
517 | if (osc_context.ret.pointer && osc_context.ret.length > 1) { | ||
518 | u32 *capbuf_ret = osc_context.ret.pointer; | ||
519 | |||
520 | if (capbuf_ret[1] & 0x1000) { | ||
521 | acpi_handle_info(handle, | ||
522 | "_OSC native thermal LVT Acked\n"); | ||
523 | acpi_hwp_native_thermal_lvt_set = true; | ||
524 | } | ||
525 | } | ||
526 | kfree(osc_context.ret.pointer); | ||
527 | } | ||
528 | |||
529 | return AE_OK; | ||
530 | } | ||
531 | |||
532 | void __init acpi_early_processor_osc(void) | ||
533 | { | ||
534 | if (boot_cpu_has(X86_FEATURE_HWP)) { | ||
535 | acpi_walk_namespace(ACPI_TYPE_PROCESSOR, ACPI_ROOT_OBJECT, | ||
536 | ACPI_UINT32_MAX, | ||
537 | acpi_hwp_native_thermal_lvt_osc, | ||
538 | NULL, NULL, NULL); | ||
539 | acpi_get_devices(ACPI_PROCESSOR_DEVICE_HID, | ||
540 | acpi_hwp_native_thermal_lvt_osc, | ||
541 | NULL, NULL); | ||
542 | } | ||
543 | } | ||
544 | #endif | ||
545 | |||
494 | /* | 546 | /* |
495 | * The following ACPI IDs are known to be suitable for representing as | 547 | * The following ACPI IDs are known to be suitable for representing as |
496 | * processor devices. | 548 | * processor devices. |