diff options
author | Matthew Garrett <mjg@redhat.com> | 2010-07-20 13:52:00 -0400 |
---|---|---|
committer | Dave Jones <davej@redhat.com> | 2010-07-26 15:25:34 -0400 |
commit | 47f8bcf362410b631a4d99ff5c79ec6b9dd3ace6 (patch) | |
tree | 2c6486e767ec0007a01db589b8eec05d90d148a0 /arch/x86/kernel/cpu/cpufreq | |
parent | 6f90388ac98e8cb2c63e307ffb13871a6b87f29b (diff) |
[CPUFREQ] pcc driver should check for pcch method before calling _OSC
The pcc specification documents an _OSC method that's incompatible with the
one defined as part of the ACPI spec. This shouldn't be a problem as both
are supposed to be guarded with a UUID. Unfortunately approximately nobody
(including HP, who wrote this spec) properly check the UUID on entry to the
_OSC call. Right now this could result in surprising behaviour if the pcc
driver performs an _OSC call on a machine that doesn't implement the pcc
specification. Check whether the PCCH method exists first in order to reduce
this probability.
Signed-off-by: Matthew Garrett <mjg@redhat.com>
Cc: Naga Chumbalkar <nagananda.chumbalkar@hp.com>
Signed-off-by: Dave Jones <davej@redhat.com>
Diffstat (limited to 'arch/x86/kernel/cpu/cpufreq')
-rw-r--r-- | arch/x86/kernel/cpu/cpufreq/pcc-cpufreq.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/arch/x86/kernel/cpu/cpufreq/pcc-cpufreq.c b/arch/x86/kernel/cpu/cpufreq/pcc-cpufreq.c index ce7cde713e71..01bd25c3c7ca 100644 --- a/arch/x86/kernel/cpu/cpufreq/pcc-cpufreq.c +++ b/arch/x86/kernel/cpu/cpufreq/pcc-cpufreq.c | |||
@@ -397,13 +397,17 @@ static int __init pcc_cpufreq_probe(void) | |||
397 | struct pcc_memory_resource *mem_resource; | 397 | struct pcc_memory_resource *mem_resource; |
398 | struct pcc_register_resource *reg_resource; | 398 | struct pcc_register_resource *reg_resource; |
399 | union acpi_object *out_obj, *member; | 399 | union acpi_object *out_obj, *member; |
400 | acpi_handle handle, osc_handle; | 400 | acpi_handle handle, osc_handle, pcch_handle; |
401 | int ret = 0; | 401 | int ret = 0; |
402 | 402 | ||
403 | status = acpi_get_handle(NULL, "\\_SB", &handle); | 403 | status = acpi_get_handle(NULL, "\\_SB", &handle); |
404 | if (ACPI_FAILURE(status)) | 404 | if (ACPI_FAILURE(status)) |
405 | return -ENODEV; | 405 | return -ENODEV; |
406 | 406 | ||
407 | status = acpi_get_handle(handle, "PCCH", &pcch_handle); | ||
408 | if (ACPI_FAILURE(status)) | ||
409 | return -ENODEV; | ||
410 | |||
407 | status = acpi_get_handle(handle, "_OSC", &osc_handle); | 411 | status = acpi_get_handle(handle, "_OSC", &osc_handle); |
408 | if (ACPI_SUCCESS(status)) { | 412 | if (ACPI_SUCCESS(status)) { |
409 | ret = pcc_cpufreq_do_osc(&osc_handle); | 413 | ret = pcc_cpufreq_do_osc(&osc_handle); |