diff options
author | Mike Travis <travis@sgi.com> | 2008-04-04 21:11:05 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-04-19 13:44:58 -0400 |
commit | fc0e474840d1fd96f28fbd76d4f36b80e7ad1cc3 (patch) | |
tree | 6076cf6b77f84557d1df0c2c95091387d5b609ad /arch/x86/kernel/cpu/cpufreq/powernow-k8.c | |
parent | 434d53b00d6bb7be0a1d3dcc0d0d5df6c042e164 (diff) |
x86: use new set_cpus_allowed_ptr function
* Use new set_cpus_allowed_ptr() function added by previous patch,
which instead of passing the "newly allowed cpus" cpumask_t arg
by value, pass it by pointer:
-int set_cpus_allowed(struct task_struct *p, cpumask_t new_mask)
+int set_cpus_allowed_ptr(struct task_struct *p, const cpumask_t *new_mask)
* Cleanup uses of CPU_MASK_ALL.
* Collapse other NR_CPUS changes to arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c
Use pointers to cpumask_t arguments whenever possible.
Depends on:
[sched-devel]: sched: add new set_cpus_allowed_ptr function
Cc: Len Brown <len.brown@intel.com>
Cc: Dave Jones <davej@codemonkey.org.uk>
Signed-off-by: Mike Travis <travis@sgi.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel/cpu/cpufreq/powernow-k8.c')
-rw-r--r-- | arch/x86/kernel/cpu/cpufreq/powernow-k8.c | 32 |
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 | ||
479 | static int check_supported_cpu(unsigned int cpu) | 479 | static 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 | ||
530 | out: | 530 | out: |
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 */ |
1016 | static int powernowk8_target(struct cpufreq_policy *pol, unsigned targfreq, unsigned relation) | 1016 | static 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 | ||
1087 | err_out: | 1087 | err_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) | |||
1104 | static int __cpuinit powernowk8_cpu_init(struct cpufreq_policy *pol) | 1104 | static 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 | ||
1207 | err_out: | 1207 | err_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 | ||
1261 | out: | 1263 | out: |
1262 | set_cpus_allowed(current, oldmask); | 1264 | set_cpus_allowed_ptr(current, &oldmask); |
1263 | return khz; | 1265 | return khz; |
1264 | } | 1266 | } |
1265 | 1267 | ||