diff options
-rw-r--r-- | arch/x86/kernel/cpu/cpufreq/powernow-k8.c | 42 | ||||
-rw-r--r-- | drivers/acpi/processor_perflib.c | 18 | ||||
-rw-r--r-- | include/linux/kernel.h | 24 |
3 files changed, 63 insertions, 21 deletions
diff --git a/arch/x86/kernel/cpu/cpufreq/powernow-k8.c b/arch/x86/kernel/cpu/cpufreq/powernow-k8.c index 84bb395038d8..4e0c6abd7ca4 100644 --- a/arch/x86/kernel/cpu/cpufreq/powernow-k8.c +++ b/arch/x86/kernel/cpu/cpufreq/powernow-k8.c | |||
@@ -45,7 +45,6 @@ | |||
45 | #endif | 45 | #endif |
46 | 46 | ||
47 | #define PFX "powernow-k8: " | 47 | #define PFX "powernow-k8: " |
48 | #define BFX PFX "BIOS error: " | ||
49 | #define VERSION "version 2.20.00" | 48 | #define VERSION "version 2.20.00" |
50 | #include "powernow-k8.h" | 49 | #include "powernow-k8.h" |
51 | 50 | ||
@@ -536,35 +535,40 @@ static int check_pst_table(struct powernow_k8_data *data, struct pst_s *pst, u8 | |||
536 | 535 | ||
537 | for (j = 0; j < data->numps; j++) { | 536 | for (j = 0; j < data->numps; j++) { |
538 | if (pst[j].vid > LEAST_VID) { | 537 | if (pst[j].vid > LEAST_VID) { |
539 | printk(KERN_ERR PFX "vid %d invalid : 0x%x\n", j, pst[j].vid); | 538 | printk(KERN_ERR FW_BUG PFX "vid %d invalid : 0x%x\n", |
539 | j, pst[j].vid); | ||
540 | return -EINVAL; | 540 | return -EINVAL; |
541 | } | 541 | } |
542 | if (pst[j].vid < data->rvo) { /* vid + rvo >= 0 */ | 542 | if (pst[j].vid < data->rvo) { /* vid + rvo >= 0 */ |
543 | printk(KERN_ERR BFX "0 vid exceeded with pstate %d\n", j); | 543 | printk(KERN_ERR FW_BUG PFX "0 vid exceeded with pstate" |
544 | " %d\n", j); | ||
544 | return -ENODEV; | 545 | return -ENODEV; |
545 | } | 546 | } |
546 | if (pst[j].vid < maxvid + data->rvo) { /* vid + rvo >= maxvid */ | 547 | if (pst[j].vid < maxvid + data->rvo) { /* vid + rvo >= maxvid */ |
547 | printk(KERN_ERR BFX "maxvid exceeded with pstate %d\n", j); | 548 | printk(KERN_ERR FW_BUG PFX "maxvid exceeded with pstate" |
549 | " %d\n", j); | ||
548 | return -ENODEV; | 550 | return -ENODEV; |
549 | } | 551 | } |
550 | if (pst[j].fid > MAX_FID) { | 552 | if (pst[j].fid > MAX_FID) { |
551 | printk(KERN_ERR BFX "maxfid exceeded with pstate %d\n", j); | 553 | printk(KERN_ERR FW_BUG PFX "maxfid exceeded with pstate" |
554 | " %d\n", j); | ||
552 | return -ENODEV; | 555 | return -ENODEV; |
553 | } | 556 | } |
554 | if (j && (pst[j].fid < HI_FID_TABLE_BOTTOM)) { | 557 | if (j && (pst[j].fid < HI_FID_TABLE_BOTTOM)) { |
555 | /* Only first fid is allowed to be in "low" range */ | 558 | /* Only first fid is allowed to be in "low" range */ |
556 | printk(KERN_ERR BFX "two low fids - %d : 0x%x\n", j, pst[j].fid); | 559 | printk(KERN_ERR FW_BUG PFX "two low fids - %d : " |
560 | "0x%x\n", j, pst[j].fid); | ||
557 | return -EINVAL; | 561 | return -EINVAL; |
558 | } | 562 | } |
559 | if (pst[j].fid < lastfid) | 563 | if (pst[j].fid < lastfid) |
560 | lastfid = pst[j].fid; | 564 | lastfid = pst[j].fid; |
561 | } | 565 | } |
562 | if (lastfid & 1) { | 566 | if (lastfid & 1) { |
563 | printk(KERN_ERR BFX "lastfid invalid\n"); | 567 | printk(KERN_ERR FW_BUG PFX "lastfid invalid\n"); |
564 | return -EINVAL; | 568 | return -EINVAL; |
565 | } | 569 | } |
566 | if (lastfid > LO_FID_TABLE_TOP) | 570 | if (lastfid > LO_FID_TABLE_TOP) |
567 | printk(KERN_INFO BFX "first fid not from lo freq table\n"); | 571 | printk(KERN_INFO FW_BUG PFX "first fid not from lo freq table\n"); |
568 | 572 | ||
569 | return 0; | 573 | return 0; |
570 | } | 574 | } |
@@ -672,13 +676,13 @@ static int find_psb_table(struct powernow_k8_data *data) | |||
672 | 676 | ||
673 | dprintk("table vers: 0x%x\n", psb->tableversion); | 677 | dprintk("table vers: 0x%x\n", psb->tableversion); |
674 | if (psb->tableversion != PSB_VERSION_1_4) { | 678 | if (psb->tableversion != PSB_VERSION_1_4) { |
675 | printk(KERN_ERR BFX "PSB table is not v1.4\n"); | 679 | printk(KERN_ERR FW_BUG PFX "PSB table is not v1.4\n"); |
676 | return -ENODEV; | 680 | return -ENODEV; |
677 | } | 681 | } |
678 | 682 | ||
679 | dprintk("flags: 0x%x\n", psb->flags1); | 683 | dprintk("flags: 0x%x\n", psb->flags1); |
680 | if (psb->flags1) { | 684 | if (psb->flags1) { |
681 | printk(KERN_ERR BFX "unknown flags\n"); | 685 | printk(KERN_ERR FW_BUG PFX "unknown flags\n"); |
682 | return -ENODEV; | 686 | return -ENODEV; |
683 | } | 687 | } |
684 | 688 | ||
@@ -705,7 +709,7 @@ static int find_psb_table(struct powernow_k8_data *data) | |||
705 | } | 709 | } |
706 | } | 710 | } |
707 | if (cpst != 1) { | 711 | if (cpst != 1) { |
708 | printk(KERN_ERR BFX "numpst must be 1\n"); | 712 | printk(KERN_ERR FW_BUG PFX "numpst must be 1\n"); |
709 | return -ENODEV; | 713 | return -ENODEV; |
710 | } | 714 | } |
711 | 715 | ||
@@ -1130,17 +1134,19 @@ static int __cpuinit powernowk8_cpu_init(struct cpufreq_policy *pol) | |||
1130 | "ACPI Processor module before starting this " | 1134 | "ACPI Processor module before starting this " |
1131 | "driver.\n"); | 1135 | "driver.\n"); |
1132 | #else | 1136 | #else |
1133 | printk(KERN_ERR PFX "Your BIOS does not provide ACPI " | 1137 | printk(KERN_ERR FW_BUG PFX "Your BIOS does not provide" |
1134 | "_PSS objects in a way that Linux understands. " | 1138 | " ACPI _PSS objects in a way that Linux " |
1135 | "Please report this to the Linux ACPI maintainers" | 1139 | "understands. Please report this to the Linux " |
1136 | " and complain to your BIOS vendor.\n"); | 1140 | "ACPI maintainers and complain to your BIOS " |
1141 | "vendor.\n"); | ||
1137 | #endif | 1142 | #endif |
1138 | kfree(data); | 1143 | kfree(data); |
1139 | return -ENODEV; | 1144 | return -ENODEV; |
1140 | } | 1145 | } |
1141 | if (pol->cpu != 0) { | 1146 | if (pol->cpu != 0) { |
1142 | printk(KERN_ERR PFX "No ACPI _PSS objects for CPU other than " | 1147 | printk(KERN_ERR FW_BUG PFX "No ACPI _PSS objects for " |
1143 | "CPU0. Complain to your BIOS vendor.\n"); | 1148 | "CPU other than CPU0. Complain to your BIOS " |
1149 | "vendor.\n"); | ||
1144 | kfree(data); | 1150 | kfree(data); |
1145 | return -ENODEV; | 1151 | return -ENODEV; |
1146 | } | 1152 | } |
@@ -1193,7 +1199,7 @@ static int __cpuinit powernowk8_cpu_init(struct cpufreq_policy *pol) | |||
1193 | 1199 | ||
1194 | /* min/max the cpu is capable of */ | 1200 | /* min/max the cpu is capable of */ |
1195 | if (cpufreq_frequency_table_cpuinfo(pol, data->powernow_table)) { | 1201 | if (cpufreq_frequency_table_cpuinfo(pol, data->powernow_table)) { |
1196 | printk(KERN_ERR PFX "invalid powernow_table\n"); | 1202 | printk(KERN_ERR FW_BUG PFX "invalid powernow_table\n"); |
1197 | powernow_k8_cpu_exit_acpi(data); | 1203 | powernow_k8_cpu_exit_acpi(data); |
1198 | kfree(data->powernow_table); | 1204 | kfree(data->powernow_table); |
1199 | kfree(data); | 1205 | kfree(data); |
diff --git a/drivers/acpi/processor_perflib.c b/drivers/acpi/processor_perflib.c index 80c251ec6d2a..242f8143008a 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> |
@@ -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 | ||
359 | int acpi_processor_notify_smm(struct module *calling_module) | 371 | int acpi_processor_notify_smm(struct module *calling_module) |
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 2651f805ba6d..0b19848e380e 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h | |||
@@ -190,6 +190,30 @@ extern int kernel_text_address(unsigned long addr); | |||
190 | struct pid; | 190 | struct pid; |
191 | extern struct pid *session_of_pgrp(struct pid *pgrp); | 191 | extern struct pid *session_of_pgrp(struct pid *pgrp); |
192 | 192 | ||
193 | /* | ||
194 | * FW_BUG | ||
195 | * Add this to a message where you are sure the firmware is buggy or behaves | ||
196 | * really stupid or out of spec. Be aware that the responsible BIOS developer | ||
197 | * should be able to fix this issue or at least get a concrete idea of the | ||
198 | * problem by reading your message without the need of looking at the kernel | ||
199 | * code. | ||
200 | * | ||
201 | * Use it for definite and high priority BIOS bugs. | ||
202 | * | ||
203 | * FW_WARN | ||
204 | * Use it for not that clear (e.g. could the kernel messed up things already?) | ||
205 | * and medium priority BIOS bugs. | ||
206 | * | ||
207 | * FW_INFO | ||
208 | * Use this one if you want to tell the user or vendor about something | ||
209 | * suspicious, but generally harmless related to the firmware. | ||
210 | * | ||
211 | * Use it for information or very low priority BIOS bugs. | ||
212 | */ | ||
213 | #define FW_BUG "[Firmware Bug]: " | ||
214 | #define FW_WARN "[Firmware Warn]: " | ||
215 | #define FW_INFO "[Firmware Info]: " | ||
216 | |||
193 | #ifdef CONFIG_PRINTK | 217 | #ifdef CONFIG_PRINTK |
194 | asmlinkage int vprintk(const char *fmt, va_list args) | 218 | asmlinkage int vprintk(const char *fmt, va_list args) |
195 | __attribute__ ((format (printf, 1, 0))); | 219 | __attribute__ ((format (printf, 1, 0))); |