diff options
Diffstat (limited to 'arch/i386/kernel/cpu/cpufreq/powernow-k8.c')
-rw-r--r-- | arch/i386/kernel/cpu/cpufreq/powernow-k8.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/arch/i386/kernel/cpu/cpufreq/powernow-k8.c b/arch/i386/kernel/cpu/cpufreq/powernow-k8.c index 712a26bd4457..7c0e160a2145 100644 --- a/arch/i386/kernel/cpu/cpufreq/powernow-k8.c +++ b/arch/i386/kernel/cpu/cpufreq/powernow-k8.c | |||
@@ -46,7 +46,7 @@ | |||
46 | 46 | ||
47 | #define PFX "powernow-k8: " | 47 | #define PFX "powernow-k8: " |
48 | #define BFX PFX "BIOS error: " | 48 | #define BFX PFX "BIOS error: " |
49 | #define VERSION "version 1.60.1" | 49 | #define VERSION "version 1.60.2" |
50 | #include "powernow-k8.h" | 50 | #include "powernow-k8.h" |
51 | 51 | ||
52 | /* serialize freq changes */ | 52 | /* serialize freq changes */ |
@@ -55,7 +55,7 @@ static DEFINE_MUTEX(fidvid_mutex); | |||
55 | static struct powernow_k8_data *powernow_data[NR_CPUS]; | 55 | static struct powernow_k8_data *powernow_data[NR_CPUS]; |
56 | 56 | ||
57 | #ifndef CONFIG_SMP | 57 | #ifndef CONFIG_SMP |
58 | static cpumask_t cpu_core_map[1] = { CPU_MASK_ALL }; | 58 | static cpumask_t cpu_core_map[1]; |
59 | #endif | 59 | #endif |
60 | 60 | ||
61 | /* Return a frequency in MHz, given an input fid */ | 61 | /* Return a frequency in MHz, given an input fid */ |
@@ -910,6 +910,9 @@ static int powernowk8_target(struct cpufreq_policy *pol, unsigned targfreq, unsi | |||
910 | unsigned int newstate; | 910 | unsigned int newstate; |
911 | int ret = -EIO; | 911 | int ret = -EIO; |
912 | 912 | ||
913 | if (!data) | ||
914 | return -EINVAL; | ||
915 | |||
913 | /* only run on specific CPU from here on */ | 916 | /* only run on specific CPU from here on */ |
914 | oldmask = current->cpus_allowed; | 917 | oldmask = current->cpus_allowed; |
915 | set_cpus_allowed(current, cpumask_of_cpu(pol->cpu)); | 918 | set_cpus_allowed(current, cpumask_of_cpu(pol->cpu)); |
@@ -969,6 +972,9 @@ static int powernowk8_verify(struct cpufreq_policy *pol) | |||
969 | { | 972 | { |
970 | struct powernow_k8_data *data = powernow_data[pol->cpu]; | 973 | struct powernow_k8_data *data = powernow_data[pol->cpu]; |
971 | 974 | ||
975 | if (!data) | ||
976 | return -EINVAL; | ||
977 | |||
972 | return cpufreq_frequency_table_verify(pol, data->powernow_table); | 978 | return cpufreq_frequency_table_verify(pol, data->powernow_table); |
973 | } | 979 | } |
974 | 980 | ||
@@ -977,7 +983,7 @@ static int __cpuinit powernowk8_cpu_init(struct cpufreq_policy *pol) | |||
977 | { | 983 | { |
978 | struct powernow_k8_data *data; | 984 | struct powernow_k8_data *data; |
979 | cpumask_t oldmask = CPU_MASK_ALL; | 985 | cpumask_t oldmask = CPU_MASK_ALL; |
980 | int rc, i; | 986 | int rc; |
981 | 987 | ||
982 | if (!cpu_online(pol->cpu)) | 988 | if (!cpu_online(pol->cpu)) |
983 | return -ENODEV; | 989 | return -ENODEV; |
@@ -1063,8 +1069,7 @@ static int __cpuinit powernowk8_cpu_init(struct cpufreq_policy *pol) | |||
1063 | printk("cpu_init done, current fid 0x%x, vid 0x%x\n", | 1069 | printk("cpu_init done, current fid 0x%x, vid 0x%x\n", |
1064 | data->currfid, data->currvid); | 1070 | data->currfid, data->currvid); |
1065 | 1071 | ||
1066 | for_each_cpu_mask(i, cpu_core_map[pol->cpu]) | 1072 | powernow_data[pol->cpu] = data; |
1067 | powernow_data[i] = data; | ||
1068 | 1073 | ||
1069 | return 0; | 1074 | return 0; |
1070 | 1075 | ||
@@ -1104,6 +1109,9 @@ static unsigned int powernowk8_get (unsigned int cpu) | |||
1104 | if (!data) | 1109 | if (!data) |
1105 | return -EINVAL; | 1110 | return -EINVAL; |
1106 | 1111 | ||
1112 | if (!data) | ||
1113 | return -EINVAL; | ||
1114 | |||
1107 | set_cpus_allowed(current, cpumask_of_cpu(cpu)); | 1115 | set_cpus_allowed(current, cpumask_of_cpu(cpu)); |
1108 | if (smp_processor_id() != cpu) { | 1116 | if (smp_processor_id() != cpu) { |
1109 | printk(KERN_ERR PFX "limiting to CPU %d failed in powernowk8_get\n", cpu); | 1117 | printk(KERN_ERR PFX "limiting to CPU %d failed in powernowk8_get\n", cpu); |