aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/cpu/cpufreq/powernow-k8.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/kernel/cpu/cpufreq/powernow-k8.c')
-rw-r--r--arch/x86/kernel/cpu/cpufreq/powernow-k8.c32
1 files changed, 17 insertions, 15 deletions
diff --git a/arch/x86/kernel/cpu/cpufreq/powernow-k8.c b/arch/x86/kernel/cpu/cpufreq/powernow-k8.c
index c99d59d8ef2e..46d4034d9f37 100644
--- a/arch/x86/kernel/cpu/cpufreq/powernow-k8.c
+++ b/arch/x86/kernel/cpu/cpufreq/powernow-k8.c
@@ -478,12 +478,12 @@ static int core_voltage_post_transition(struct powernow_k8_data *data, u32 reqvi
478 478
479static int check_supported_cpu(unsigned int cpu) 479static int check_supported_cpu(unsigned int cpu)
480{ 480{
481 cpumask_t oldmask = CPU_MASK_ALL; 481 cpumask_t oldmask;
482 u32 eax, ebx, ecx, edx; 482 u32 eax, ebx, ecx, edx;
483 unsigned int rc = 0; 483 unsigned int rc = 0;
484 484
485 oldmask = current->cpus_allowed; 485 oldmask = current->cpus_allowed;
486 set_cpus_allowed(current, cpumask_of_cpu(cpu)); 486 set_cpus_allowed_ptr(current, &cpumask_of_cpu(cpu));
487 487
488 if (smp_processor_id() != cpu) { 488 if (smp_processor_id() != cpu) {
489 printk(KERN_ERR PFX "limiting to cpu %u failed\n", cpu); 489 printk(KERN_ERR PFX "limiting to cpu %u failed\n", cpu);
@@ -528,7 +528,7 @@ static int check_supported_cpu(unsigned int cpu)
528 rc = 1; 528 rc = 1;
529 529
530out: 530out:
531 set_cpus_allowed(current, oldmask); 531 set_cpus_allowed_ptr(current, &oldmask);
532 return rc; 532 return rc;
533} 533}
534 534
@@ -1015,7 +1015,7 @@ static int transition_frequency_pstate(struct powernow_k8_data *data, unsigned i
1015/* Driver entry point to switch to the target frequency */ 1015/* Driver entry point to switch to the target frequency */
1016static int powernowk8_target(struct cpufreq_policy *pol, unsigned targfreq, unsigned relation) 1016static int powernowk8_target(struct cpufreq_policy *pol, unsigned targfreq, unsigned relation)
1017{ 1017{
1018 cpumask_t oldmask = CPU_MASK_ALL; 1018 cpumask_t oldmask;
1019 struct powernow_k8_data *data = per_cpu(powernow_data, pol->cpu); 1019 struct powernow_k8_data *data = per_cpu(powernow_data, pol->cpu);
1020 u32 checkfid; 1020 u32 checkfid;
1021 u32 checkvid; 1021 u32 checkvid;
@@ -1030,7 +1030,7 @@ static int powernowk8_target(struct cpufreq_policy *pol, unsigned targfreq, unsi
1030 1030
1031 /* only run on specific CPU from here on */ 1031 /* only run on specific CPU from here on */
1032 oldmask = current->cpus_allowed; 1032 oldmask = current->cpus_allowed;
1033 set_cpus_allowed(current, cpumask_of_cpu(pol->cpu)); 1033 set_cpus_allowed_ptr(current, &cpumask_of_cpu(pol->cpu));
1034 1034
1035 if (smp_processor_id() != pol->cpu) { 1035 if (smp_processor_id() != pol->cpu) {
1036 printk(KERN_ERR PFX "limiting to cpu %u failed\n", pol->cpu); 1036 printk(KERN_ERR PFX "limiting to cpu %u failed\n", pol->cpu);
@@ -1085,7 +1085,7 @@ static int powernowk8_target(struct cpufreq_policy *pol, unsigned targfreq, unsi
1085 ret = 0; 1085 ret = 0;
1086 1086
1087err_out: 1087err_out:
1088 set_cpus_allowed(current, oldmask); 1088 set_cpus_allowed_ptr(current, &oldmask);
1089 return ret; 1089 return ret;
1090} 1090}
1091 1091
@@ -1104,7 +1104,7 @@ static int powernowk8_verify(struct cpufreq_policy *pol)
1104static int __cpuinit powernowk8_cpu_init(struct cpufreq_policy *pol) 1104static int __cpuinit powernowk8_cpu_init(struct cpufreq_policy *pol)
1105{ 1105{
1106 struct powernow_k8_data *data; 1106 struct powernow_k8_data *data;
1107 cpumask_t oldmask = CPU_MASK_ALL; 1107 cpumask_t oldmask;
1108 int rc; 1108 int rc;
1109 1109
1110 if (!cpu_online(pol->cpu)) 1110 if (!cpu_online(pol->cpu))
@@ -1145,7 +1145,7 @@ static int __cpuinit powernowk8_cpu_init(struct cpufreq_policy *pol)
1145 1145
1146 /* only run on specific CPU from here on */ 1146 /* only run on specific CPU from here on */
1147 oldmask = current->cpus_allowed; 1147 oldmask = current->cpus_allowed;
1148 set_cpus_allowed(current, cpumask_of_cpu(pol->cpu)); 1148 set_cpus_allowed_ptr(current, &cpumask_of_cpu(pol->cpu));
1149 1149
1150 if (smp_processor_id() != pol->cpu) { 1150 if (smp_processor_id() != pol->cpu) {
1151 printk(KERN_ERR PFX "limiting to cpu %u failed\n", pol->cpu); 1151 printk(KERN_ERR PFX "limiting to cpu %u failed\n", pol->cpu);
@@ -1164,7 +1164,7 @@ static int __cpuinit powernowk8_cpu_init(struct cpufreq_policy *pol)
1164 fidvid_msr_init(); 1164 fidvid_msr_init();
1165 1165
1166 /* run on any CPU again */ 1166 /* run on any CPU again */
1167 set_cpus_allowed(current, oldmask); 1167 set_cpus_allowed_ptr(current, &oldmask);
1168 1168
1169 if (cpu_family == CPU_HW_PSTATE) 1169 if (cpu_family == CPU_HW_PSTATE)
1170 pol->cpus = cpumask_of_cpu(pol->cpu); 1170 pol->cpus = cpumask_of_cpu(pol->cpu);
@@ -1205,7 +1205,7 @@ static int __cpuinit powernowk8_cpu_init(struct cpufreq_policy *pol)
1205 return 0; 1205 return 0;
1206 1206
1207err_out: 1207err_out:
1208 set_cpus_allowed(current, oldmask); 1208 set_cpus_allowed_ptr(current, &oldmask);
1209 powernow_k8_cpu_exit_acpi(data); 1209 powernow_k8_cpu_exit_acpi(data);
1210 1210
1211 kfree(data); 1211 kfree(data);
@@ -1242,10 +1242,11 @@ static unsigned int powernowk8_get (unsigned int cpu)
1242 if (!data) 1242 if (!data)
1243 return -EINVAL; 1243 return -EINVAL;
1244 1244
1245 set_cpus_allowed(current, cpumask_of_cpu(cpu)); 1245 set_cpus_allowed_ptr(current, &cpumask_of_cpu(cpu));
1246 if (smp_processor_id() != cpu) { 1246 if (smp_processor_id() != cpu) {
1247 printk(KERN_ERR PFX "limiting to CPU %d failed in powernowk8_get\n", cpu); 1247 printk(KERN_ERR PFX
1248 set_cpus_allowed(current, oldmask); 1248 "limiting to CPU %d failed in powernowk8_get\n", cpu);
1249 set_cpus_allowed_ptr(current, &oldmask);
1249 return 0; 1250 return 0;
1250 } 1251 }
1251 1252
@@ -1253,13 +1254,14 @@ static unsigned int powernowk8_get (unsigned int cpu)
1253 goto out; 1254 goto out;
1254 1255
1255 if (cpu_family == CPU_HW_PSTATE) 1256 if (cpu_family == CPU_HW_PSTATE)
1256 khz = find_khz_freq_from_pstate(data->powernow_table, data->currpstate); 1257 khz = find_khz_freq_from_pstate(data->powernow_table,
1258 data->currpstate);
1257 else 1259 else
1258 khz = find_khz_freq_from_fid(data->currfid); 1260 khz = find_khz_freq_from_fid(data->currfid);
1259 1261
1260 1262
1261out: 1263out:
1262 set_cpus_allowed(current, oldmask); 1264 set_cpus_allowed_ptr(current, &oldmask);
1263 return khz; 1265 return khz;
1264} 1266}
1265 1267