diff options
author | Marco Aurelio da Costa <costa@gamic.com> | 2012-05-04 12:53:44 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2012-05-08 01:56:37 -0400 |
commit | d8e725f356fd5f225ad97f21213fc007e409c9f5 (patch) | |
tree | f4313d66f9331b4dd5bbd7f86aba948c17ea2990 /drivers/acpi | |
parent | febb72a6e4cc6c8cffcc1ea649a3fb364f1ea432 (diff) |
ACPI: Ignore invalid _PSS entries, but use valid ones
The EliteBook 8560W has non-initialized entries in its _PSS ACPI
table. Instead of bailing out when the first non-initialized entry is
found, ignore it and use only the valid entries. Only bail out if there
is no valid entry at all.
[v3: Fixes suggested by Konrad]
Signed-off-by: Marco Aurelio da Costa <costa@gamic.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi')
-rw-r--r-- | drivers/acpi/processor_perflib.c | 30 |
1 files changed, 25 insertions, 5 deletions
diff --git a/drivers/acpi/processor_perflib.c b/drivers/acpi/processor_perflib.c index 0af48a8554cd..a093dc163a42 100644 --- a/drivers/acpi/processor_perflib.c +++ b/drivers/acpi/processor_perflib.c | |||
@@ -333,6 +333,7 @@ static int acpi_processor_get_performance_states(struct acpi_processor *pr) | |||
333 | struct acpi_buffer state = { 0, NULL }; | 333 | struct acpi_buffer state = { 0, NULL }; |
334 | union acpi_object *pss = NULL; | 334 | union acpi_object *pss = NULL; |
335 | int i; | 335 | int i; |
336 | int last_invalid = -1; | ||
336 | 337 | ||
337 | 338 | ||
338 | status = acpi_evaluate_object(pr->handle, "_PSS", NULL, &buffer); | 339 | status = acpi_evaluate_object(pr->handle, "_PSS", NULL, &buffer); |
@@ -394,14 +395,33 @@ static int acpi_processor_get_performance_states(struct acpi_processor *pr) | |||
394 | ((u32)(px->core_frequency * 1000) != | 395 | ((u32)(px->core_frequency * 1000) != |
395 | (px->core_frequency * 1000))) { | 396 | (px->core_frequency * 1000))) { |
396 | printk(KERN_ERR FW_BUG PREFIX | 397 | printk(KERN_ERR FW_BUG PREFIX |
397 | "Invalid BIOS _PSS frequency: 0x%llx MHz\n", | 398 | "Invalid BIOS _PSS frequency found for processor %d: 0x%llx MHz\n", |
398 | px->core_frequency); | 399 | pr->id, px->core_frequency); |
399 | result = -EFAULT; | 400 | if (last_invalid == -1) |
400 | kfree(pr->performance->states); | 401 | last_invalid = i; |
401 | goto end; | 402 | } else { |
403 | if (last_invalid != -1) { | ||
404 | /* | ||
405 | * Copy this valid entry over last_invalid entry | ||
406 | */ | ||
407 | memcpy(&(pr->performance->states[last_invalid]), | ||
408 | px, sizeof(struct acpi_processor_px)); | ||
409 | ++last_invalid; | ||
410 | } | ||
402 | } | 411 | } |
403 | } | 412 | } |
404 | 413 | ||
414 | if (last_invalid == 0) { | ||
415 | printk(KERN_ERR FW_BUG PREFIX | ||
416 | "No valid BIOS _PSS frequency found for processor %d\n", pr->id); | ||
417 | result = -EFAULT; | ||
418 | kfree(pr->performance->states); | ||
419 | pr->performance->states = NULL; | ||
420 | } | ||
421 | |||
422 | if (last_invalid > 0) | ||
423 | pr->performance->state_count = last_invalid; | ||
424 | |||
405 | end: | 425 | end: |
406 | kfree(buffer.pointer); | 426 | kfree(buffer.pointer); |
407 | 427 | ||