diff options
Diffstat (limited to 'arch/i386/kernel/cpu/cpufreq/powernow-k8.c')
-rw-r--r-- | arch/i386/kernel/cpu/cpufreq/powernow-k8.c | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/arch/i386/kernel/cpu/cpufreq/powernow-k8.c b/arch/i386/kernel/cpu/cpufreq/powernow-k8.c index 712a26bd4457..71fffa174425 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 */ |
@@ -905,11 +905,17 @@ static int powernowk8_target(struct cpufreq_policy *pol, unsigned targfreq, unsi | |||
905 | { | 905 | { |
906 | cpumask_t oldmask = CPU_MASK_ALL; | 906 | cpumask_t oldmask = CPU_MASK_ALL; |
907 | struct powernow_k8_data *data = powernow_data[pol->cpu]; | 907 | struct powernow_k8_data *data = powernow_data[pol->cpu]; |
908 | u32 checkfid = data->currfid; | 908 | u32 checkfid; |
909 | u32 checkvid = data->currvid; | 909 | u32 checkvid; |
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 | |||
916 | checkfid = data->currfid; | ||
917 | checkvid = data->currvid; | ||
918 | |||
913 | /* only run on specific CPU from here on */ | 919 | /* only run on specific CPU from here on */ |
914 | oldmask = current->cpus_allowed; | 920 | oldmask = current->cpus_allowed; |
915 | set_cpus_allowed(current, cpumask_of_cpu(pol->cpu)); | 921 | set_cpus_allowed(current, cpumask_of_cpu(pol->cpu)); |
@@ -969,6 +975,9 @@ static int powernowk8_verify(struct cpufreq_policy *pol) | |||
969 | { | 975 | { |
970 | struct powernow_k8_data *data = powernow_data[pol->cpu]; | 976 | struct powernow_k8_data *data = powernow_data[pol->cpu]; |
971 | 977 | ||
978 | if (!data) | ||
979 | return -EINVAL; | ||
980 | |||
972 | return cpufreq_frequency_table_verify(pol, data->powernow_table); | 981 | return cpufreq_frequency_table_verify(pol, data->powernow_table); |
973 | } | 982 | } |
974 | 983 | ||
@@ -977,7 +986,7 @@ static int __cpuinit powernowk8_cpu_init(struct cpufreq_policy *pol) | |||
977 | { | 986 | { |
978 | struct powernow_k8_data *data; | 987 | struct powernow_k8_data *data; |
979 | cpumask_t oldmask = CPU_MASK_ALL; | 988 | cpumask_t oldmask = CPU_MASK_ALL; |
980 | int rc, i; | 989 | int rc; |
981 | 990 | ||
982 | if (!cpu_online(pol->cpu)) | 991 | if (!cpu_online(pol->cpu)) |
983 | return -ENODEV; | 992 | return -ENODEV; |
@@ -1063,8 +1072,7 @@ static int __cpuinit powernowk8_cpu_init(struct cpufreq_policy *pol) | |||
1063 | printk("cpu_init done, current fid 0x%x, vid 0x%x\n", | 1072 | printk("cpu_init done, current fid 0x%x, vid 0x%x\n", |
1064 | data->currfid, data->currvid); | 1073 | data->currfid, data->currvid); |
1065 | 1074 | ||
1066 | for_each_cpu_mask(i, cpu_core_map[pol->cpu]) | 1075 | powernow_data[pol->cpu] = data; |
1067 | powernow_data[i] = data; | ||
1068 | 1076 | ||
1069 | return 0; | 1077 | return 0; |
1070 | 1078 | ||