diff options
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 | ||