diff options
Diffstat (limited to 'arch/x86/kernel/cpu/cpufreq/powernow-k8.c')
-rw-r--r-- | arch/x86/kernel/cpu/cpufreq/powernow-k8.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/arch/x86/kernel/cpu/cpufreq/powernow-k8.c b/arch/x86/kernel/cpu/cpufreq/powernow-k8.c index 99e1ef9939be..5affe91ca1e5 100644 --- a/arch/x86/kernel/cpu/cpufreq/powernow-k8.c +++ b/arch/x86/kernel/cpu/cpufreq/powernow-k8.c | |||
@@ -52,7 +52,7 @@ | |||
52 | /* serialize freq changes */ | 52 | /* serialize freq changes */ |
53 | static DEFINE_MUTEX(fidvid_mutex); | 53 | static DEFINE_MUTEX(fidvid_mutex); |
54 | 54 | ||
55 | static struct powernow_k8_data *powernow_data[NR_CPUS]; | 55 | static DEFINE_PER_CPU(struct powernow_k8_data *, powernow_data); |
56 | 56 | ||
57 | static int cpu_family = CPU_OPTERON; | 57 | static int cpu_family = CPU_OPTERON; |
58 | 58 | ||
@@ -827,7 +827,6 @@ static int fill_powernow_table_pstate(struct powernow_k8_data *data, struct cpuf | |||
827 | 827 | ||
828 | for (i = 0; i < data->acpi_data.state_count; i++) { | 828 | for (i = 0; i < data->acpi_data.state_count; i++) { |
829 | u32 index; | 829 | u32 index; |
830 | u32 hi = 0, lo = 0; | ||
831 | 830 | ||
832 | index = data->acpi_data.states[i].control & HW_PSTATE_MASK; | 831 | index = data->acpi_data.states[i].control & HW_PSTATE_MASK; |
833 | if (index > data->max_hw_pstate) { | 832 | if (index > data->max_hw_pstate) { |
@@ -1018,7 +1017,7 @@ static int transition_frequency_pstate(struct powernow_k8_data *data, unsigned i | |||
1018 | static int powernowk8_target(struct cpufreq_policy *pol, unsigned targfreq, unsigned relation) | 1017 | static int powernowk8_target(struct cpufreq_policy *pol, unsigned targfreq, unsigned relation) |
1019 | { | 1018 | { |
1020 | cpumask_t oldmask = CPU_MASK_ALL; | 1019 | cpumask_t oldmask = CPU_MASK_ALL; |
1021 | struct powernow_k8_data *data = powernow_data[pol->cpu]; | 1020 | struct powernow_k8_data *data = per_cpu(powernow_data, pol->cpu); |
1022 | u32 checkfid; | 1021 | u32 checkfid; |
1023 | u32 checkvid; | 1022 | u32 checkvid; |
1024 | unsigned int newstate; | 1023 | unsigned int newstate; |
@@ -1094,7 +1093,7 @@ err_out: | |||
1094 | /* Driver entry point to verify the policy and range of frequencies */ | 1093 | /* Driver entry point to verify the policy and range of frequencies */ |
1095 | static int powernowk8_verify(struct cpufreq_policy *pol) | 1094 | static int powernowk8_verify(struct cpufreq_policy *pol) |
1096 | { | 1095 | { |
1097 | struct powernow_k8_data *data = powernow_data[pol->cpu]; | 1096 | struct powernow_k8_data *data = per_cpu(powernow_data, pol->cpu); |
1098 | 1097 | ||
1099 | if (!data) | 1098 | if (!data) |
1100 | return -EINVAL; | 1099 | return -EINVAL; |
@@ -1202,7 +1201,7 @@ static int __cpuinit powernowk8_cpu_init(struct cpufreq_policy *pol) | |||
1202 | dprintk("cpu_init done, current fid 0x%x, vid 0x%x\n", | 1201 | dprintk("cpu_init done, current fid 0x%x, vid 0x%x\n", |
1203 | data->currfid, data->currvid); | 1202 | data->currfid, data->currvid); |
1204 | 1203 | ||
1205 | powernow_data[pol->cpu] = data; | 1204 | per_cpu(powernow_data, pol->cpu) = data; |
1206 | 1205 | ||
1207 | return 0; | 1206 | return 0; |
1208 | 1207 | ||
@@ -1216,7 +1215,7 @@ err_out: | |||
1216 | 1215 | ||
1217 | static int __devexit powernowk8_cpu_exit (struct cpufreq_policy *pol) | 1216 | static int __devexit powernowk8_cpu_exit (struct cpufreq_policy *pol) |
1218 | { | 1217 | { |
1219 | struct powernow_k8_data *data = powernow_data[pol->cpu]; | 1218 | struct powernow_k8_data *data = per_cpu(powernow_data, pol->cpu); |
1220 | 1219 | ||
1221 | if (!data) | 1220 | if (!data) |
1222 | return -EINVAL; | 1221 | return -EINVAL; |
@@ -1237,7 +1236,7 @@ static unsigned int powernowk8_get (unsigned int cpu) | |||
1237 | cpumask_t oldmask = current->cpus_allowed; | 1236 | cpumask_t oldmask = current->cpus_allowed; |
1238 | unsigned int khz = 0; | 1237 | unsigned int khz = 0; |
1239 | 1238 | ||
1240 | data = powernow_data[first_cpu(per_cpu(cpu_core_map, cpu))]; | 1239 | data = per_cpu(powernow_data, first_cpu(per_cpu(cpu_core_map, cpu))); |
1241 | 1240 | ||
1242 | if (!data) | 1241 | if (!data) |
1243 | return -EINVAL; | 1242 | return -EINVAL; |