diff options
Diffstat (limited to 'arch/i386/kernel/cpu/cpufreq/powernow-k8.c')
-rw-r--r-- | arch/i386/kernel/cpu/cpufreq/powernow-k8.c | 31 |
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 | ||
1165 | MODULE_AUTHOR("Paul Devriendt <paul.devriendt@amd.com> and Mark Langsdorf <mark.langsdorf@amd.com."); | 1174 | MODULE_AUTHOR("Paul Devriendt <paul.devriendt@amd.com> and Mark Langsdorf <mark.langsdorf@amd.com>"); |
1166 | MODULE_DESCRIPTION("AMD Athlon 64 and Opteron processor frequency driver."); | 1175 | MODULE_DESCRIPTION("AMD Athlon 64 and Opteron processor frequency driver."); |
1167 | MODULE_LICENSE("GPL"); | 1176 | MODULE_LICENSE("GPL"); |
1168 | 1177 | ||