aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/processor_perflib.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/processor_perflib.c')
-rw-r--r--drivers/acpi/processor_perflib.c30
1 files changed, 21 insertions, 9 deletions
diff --git a/drivers/acpi/processor_perflib.c b/drivers/acpi/processor_perflib.c
index 80c251ec6d2a..dc98f7a6f2c4 100644
--- a/drivers/acpi/processor_perflib.c
+++ b/drivers/acpi/processor_perflib.c
@@ -38,6 +38,7 @@
38 38
39#include <asm/uaccess.h> 39#include <asm/uaccess.h>
40#endif 40#endif
41#include <asm/cpufeature.h>
41 42
42#include <acpi/acpi_bus.h> 43#include <acpi/acpi_bus.h>
43#include <acpi/processor.h> 44#include <acpi/processor.h>
@@ -126,7 +127,7 @@ static struct notifier_block acpi_ppc_notifier_block = {
126static int acpi_processor_get_platform_limit(struct acpi_processor *pr) 127static int acpi_processor_get_platform_limit(struct acpi_processor *pr)
127{ 128{
128 acpi_status status = 0; 129 acpi_status status = 0;
129 unsigned long ppc = 0; 130 unsigned long long ppc = 0;
130 131
131 132
132 if (!pr) 133 if (!pr)
@@ -334,7 +335,6 @@ static int acpi_processor_get_performance_info(struct acpi_processor *pr)
334 acpi_status status = AE_OK; 335 acpi_status status = AE_OK;
335 acpi_handle handle = NULL; 336 acpi_handle handle = NULL;
336 337
337
338 if (!pr || !pr->performance || !pr->handle) 338 if (!pr || !pr->performance || !pr->handle)
339 return -EINVAL; 339 return -EINVAL;
340 340
@@ -347,13 +347,25 @@ static int acpi_processor_get_performance_info(struct acpi_processor *pr)
347 347
348 result = acpi_processor_get_performance_control(pr); 348 result = acpi_processor_get_performance_control(pr);
349 if (result) 349 if (result)
350 return result; 350 goto update_bios;
351 351
352 result = acpi_processor_get_performance_states(pr); 352 result = acpi_processor_get_performance_states(pr);
353 if (result) 353 if (result)
354 return result; 354 goto update_bios;
355 355
356 return 0; 356 return 0;
357
358 /*
359 * Having _PPC but missing frequencies (_PSS, _PCT) is a very good hint that
360 * the BIOS is older than the CPU and does not know its frequencies
361 */
362 update_bios:
363 if (ACPI_SUCCESS(acpi_get_handle(pr->handle, "_PPC", &handle))){
364 if(boot_cpu_has(X86_FEATURE_EST))
365 printk(KERN_WARNING FW_BUG "BIOS needs update for CPU "
366 "frequency support\n");
367 }
368 return result;
357} 369}
358 370
359int acpi_processor_notify_smm(struct module *calling_module) 371int acpi_processor_notify_smm(struct module *calling_module)
@@ -524,13 +536,13 @@ static int acpi_processor_get_psd(struct acpi_processor *pr)
524 536
525 psd = buffer.pointer; 537 psd = buffer.pointer;
526 if (!psd || (psd->type != ACPI_TYPE_PACKAGE)) { 538 if (!psd || (psd->type != ACPI_TYPE_PACKAGE)) {
527 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid _PSD data\n")); 539 printk(KERN_ERR PREFIX "Invalid _PSD data\n");
528 result = -EFAULT; 540 result = -EFAULT;
529 goto end; 541 goto end;
530 } 542 }
531 543
532 if (psd->package.count != 1) { 544 if (psd->package.count != 1) {
533 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid _PSD data\n")); 545 printk(KERN_ERR PREFIX "Invalid _PSD data\n");
534 result = -EFAULT; 546 result = -EFAULT;
535 goto end; 547 goto end;
536 } 548 }
@@ -543,19 +555,19 @@ static int acpi_processor_get_psd(struct acpi_processor *pr)
543 status = acpi_extract_package(&(psd->package.elements[0]), 555 status = acpi_extract_package(&(psd->package.elements[0]),
544 &format, &state); 556 &format, &state);
545 if (ACPI_FAILURE(status)) { 557 if (ACPI_FAILURE(status)) {
546 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid _PSD data\n")); 558 printk(KERN_ERR PREFIX "Invalid _PSD data\n");
547 result = -EFAULT; 559 result = -EFAULT;
548 goto end; 560 goto end;
549 } 561 }
550 562
551 if (pdomain->num_entries != ACPI_PSD_REV0_ENTRIES) { 563 if (pdomain->num_entries != ACPI_PSD_REV0_ENTRIES) {
552 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Unknown _PSD:num_entries\n")); 564 printk(KERN_ERR PREFIX "Unknown _PSD:num_entries\n");
553 result = -EFAULT; 565 result = -EFAULT;
554 goto end; 566 goto end;
555 } 567 }
556 568
557 if (pdomain->revision != ACPI_PSD_REV0_REVISION) { 569 if (pdomain->revision != ACPI_PSD_REV0_REVISION) {
558 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Unknown _PSD:revision\n")); 570 printk(KERN_ERR PREFIX "Unknown _PSD:revision\n");
559 result = -EFAULT; 571 result = -EFAULT;
560 goto end; 572 goto end;
561 } 573 }