aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorJacob Shin <jacob.shin@amd.com>2005-11-21 10:23:08 -0500
committerDave Jones <davej@redhat.com>2005-11-21 10:23:08 -0500
commit8aae8284fece2b8fc404ccd40b7a30aa96f317b5 (patch)
tree3de7b27c168c1f34a7db3e394a590fa44a9656ca /arch
parentdb93a82fa9d8b4d6e31c227922eaae829253bb88 (diff)
[CPUFREQ] Improve Error reporting in powernow-k8
This patch cleans up some error messages in the powernow-k8 driver and makes them more understandable. Signed-off-by: Jacob Shin <jacob.shin@amd.com> Signed-off-by: Mark Langsdorf <mark.langsdorf@amd.com> Signed-off-by: Dave Jones <davej@redhat.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/i386/kernel/cpu/cpufreq/powernow-k8.c31
1 files changed, 20 insertions, 11 deletions
diff --git a/arch/i386/kernel/cpu/cpufreq/powernow-k8.c b/arch/i386/kernel/cpu/cpufreq/powernow-k8.c
index 68a1fc87f4ca..349782736808 100644
--- a/arch/i386/kernel/cpu/cpufreq/powernow-k8.c
+++ b/arch/i386/kernel/cpu/cpufreq/powernow-k8.c
@@ -45,7 +45,7 @@
45 45
46#define PFX "powernow-k8: " 46#define PFX "powernow-k8: "
47#define BFX PFX "BIOS error: " 47#define BFX PFX "BIOS error: "
48#define VERSION "version 1.50.4" 48#define VERSION "version 1.50.5"
49#include "powernow-k8.h" 49#include "powernow-k8.h"
50 50
51/* serialize freq changes */ 51/* serialize freq changes */
@@ -464,7 +464,7 @@ static int check_supported_cpu(unsigned int cpu)
464 set_cpus_allowed(current, cpumask_of_cpu(cpu)); 464 set_cpus_allowed(current, cpumask_of_cpu(cpu));
465 465
466 if (smp_processor_id() != cpu) { 466 if (smp_processor_id() != cpu) {
467 printk(KERN_ERR "limiting to cpu %u failed\n", cpu); 467 printk(KERN_ERR PFX "limiting to cpu %u failed\n", cpu);
468 goto out; 468 goto out;
469 } 469 }
470 470
@@ -517,22 +517,28 @@ static int check_pst_table(struct powernow_k8_data *data, struct pst_s *pst, u8
517 printk(KERN_ERR BFX "maxvid exceeded with pstate %d\n", j); 517 printk(KERN_ERR BFX "maxvid exceeded with pstate %d\n", j);
518 return -ENODEV; 518 return -ENODEV;
519 } 519 }
520 if ((pst[j].fid > MAX_FID) 520 if (pst[j].fid > MAX_FID) {
521 || (pst[j].fid & 1) 521 printk(KERN_ERR BFX "maxfid exceeded with pstate %d\n", j);
522 || (j && (pst[j].fid < HI_FID_TABLE_BOTTOM))) { 522 return -ENODEV;
523 }
524 if (pst[j].fid & 1) {
525 printk(KERN_ERR BFX "fid invalid - %d : 0x%x\n", j, pst[j].fid);
526 return -EINVAL;
527 }
528 if (j && (pst[j].fid < HI_FID_TABLE_BOTTOM)) {
523 /* Only first fid is allowed to be in "low" range */ 529 /* Only first fid is allowed to be in "low" range */
524 printk(KERN_ERR PFX "two low fids - %d : 0x%x\n", j, pst[j].fid); 530 printk(KERN_ERR BFX "two low fids - %d : 0x%x\n", j, pst[j].fid);
525 return -EINVAL; 531 return -EINVAL;
526 } 532 }
527 if (pst[j].fid < lastfid) 533 if (pst[j].fid < lastfid)
528 lastfid = pst[j].fid; 534 lastfid = pst[j].fid;
529 } 535 }
530 if (lastfid & 1) { 536 if (lastfid & 1) {
531 printk(KERN_ERR PFX "lastfid invalid\n"); 537 printk(KERN_ERR BFX "lastfid invalid\n");
532 return -EINVAL; 538 return -EINVAL;
533 } 539 }
534 if (lastfid > LO_FID_TABLE_TOP) 540 if (lastfid > LO_FID_TABLE_TOP)
535 printk(KERN_INFO PFX "first fid not from lo freq table\n"); 541 printk(KERN_INFO BFX "first fid not from lo freq table\n");
536 542
537 return 0; 543 return 0;
538} 544}
@@ -912,7 +918,7 @@ static int powernowk8_target(struct cpufreq_policy *pol, unsigned targfreq, unsi
912 set_cpus_allowed(current, cpumask_of_cpu(pol->cpu)); 918 set_cpus_allowed(current, cpumask_of_cpu(pol->cpu));
913 919
914 if (smp_processor_id() != pol->cpu) { 920 if (smp_processor_id() != pol->cpu) {
915 printk(KERN_ERR "limiting to cpu %u failed\n", pol->cpu); 921 printk(KERN_ERR PFX "limiting to cpu %u failed\n", pol->cpu);
916 goto err_out; 922 goto err_out;
917 } 923 }
918 924
@@ -982,6 +988,9 @@ static int __init powernowk8_cpu_init(struct cpufreq_policy *pol)
982 cpumask_t oldmask = CPU_MASK_ALL; 988 cpumask_t oldmask = CPU_MASK_ALL;
983 int rc, i; 989 int rc, i;
984 990
991 if (!cpu_online(pol->cpu))
992 return -ENODEV;
993
985 if (!check_supported_cpu(pol->cpu)) 994 if (!check_supported_cpu(pol->cpu))
986 return -ENODEV; 995 return -ENODEV;
987 996
@@ -1021,7 +1030,7 @@ static int __init powernowk8_cpu_init(struct cpufreq_policy *pol)
1021 set_cpus_allowed(current, cpumask_of_cpu(pol->cpu)); 1030 set_cpus_allowed(current, cpumask_of_cpu(pol->cpu));
1022 1031
1023 if (smp_processor_id() != pol->cpu) { 1032 if (smp_processor_id() != pol->cpu) {
1024 printk(KERN_ERR "limiting to cpu %u failed\n", pol->cpu); 1033 printk(KERN_ERR PFX "limiting to cpu %u failed\n", pol->cpu);
1025 goto err_out; 1034 goto err_out;
1026 } 1035 }
1027 1036
@@ -1162,7 +1171,7 @@ static void __exit powernowk8_exit(void)
1162 cpufreq_unregister_driver(&cpufreq_amd64_driver); 1171 cpufreq_unregister_driver(&cpufreq_amd64_driver);
1163} 1172}
1164 1173
1165MODULE_AUTHOR("Paul Devriendt <paul.devriendt@amd.com> and Mark Langsdorf <mark.langsdorf@amd.com."); 1174MODULE_AUTHOR("Paul Devriendt <paul.devriendt@amd.com> and Mark Langsdorf <mark.langsdorf@amd.com>");
1166MODULE_DESCRIPTION("AMD Athlon 64 and Opteron processor frequency driver."); 1175MODULE_DESCRIPTION("AMD Athlon 64 and Opteron processor frequency driver.");
1167MODULE_LICENSE("GPL"); 1176MODULE_LICENSE("GPL");
1168 1177