diff options
| -rw-r--r-- | arch/x86/kernel/cpu/cpufreq/powernow-k8.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/arch/x86/kernel/cpu/cpufreq/powernow-k8.c b/arch/x86/kernel/cpu/cpufreq/powernow-k8.c index 3f12dabeab52..f30d25383940 100644 --- a/arch/x86/kernel/cpu/cpufreq/powernow-k8.c +++ b/arch/x86/kernel/cpu/cpufreq/powernow-k8.c | |||
| @@ -1118,7 +1118,7 @@ static int transition_frequency_pstate(struct powernow_k8_data *data, | |||
| 1118 | static int powernowk8_target(struct cpufreq_policy *pol, | 1118 | static int powernowk8_target(struct cpufreq_policy *pol, |
| 1119 | unsigned targfreq, unsigned relation) | 1119 | unsigned targfreq, unsigned relation) |
| 1120 | { | 1120 | { |
| 1121 | cpumask_t oldmask; | 1121 | cpumask_var_t oldmask; |
| 1122 | struct powernow_k8_data *data = per_cpu(powernow_data, pol->cpu); | 1122 | struct powernow_k8_data *data = per_cpu(powernow_data, pol->cpu); |
| 1123 | u32 checkfid; | 1123 | u32 checkfid; |
| 1124 | u32 checkvid; | 1124 | u32 checkvid; |
| @@ -1131,9 +1131,13 @@ static int powernowk8_target(struct cpufreq_policy *pol, | |||
| 1131 | checkfid = data->currfid; | 1131 | checkfid = data->currfid; |
| 1132 | checkvid = data->currvid; | 1132 | checkvid = data->currvid; |
| 1133 | 1133 | ||
| 1134 | /* only run on specific CPU from here on */ | 1134 | /* only run on specific CPU from here on. */ |
| 1135 | oldmask = current->cpus_allowed; | 1135 | /* This is poor form: use a workqueue or smp_call_function_single */ |
| 1136 | set_cpus_allowed_ptr(current, &cpumask_of_cpu(pol->cpu)); | 1136 | if (!alloc_cpumask_var(&oldmask, GFP_KERNEL)) |
| 1137 | return -ENOMEM; | ||
| 1138 | |||
| 1139 | cpumask_copy(oldmask, tsk_cpumask(current)); | ||
| 1140 | set_cpus_allowed_ptr(current, cpumask_of(pol->cpu)); | ||
| 1137 | 1141 | ||
| 1138 | if (smp_processor_id() != pol->cpu) { | 1142 | if (smp_processor_id() != pol->cpu) { |
| 1139 | printk(KERN_ERR PFX "limiting to cpu %u failed\n", pol->cpu); | 1143 | printk(KERN_ERR PFX "limiting to cpu %u failed\n", pol->cpu); |
| @@ -1193,7 +1197,8 @@ static int powernowk8_target(struct cpufreq_policy *pol, | |||
| 1193 | ret = 0; | 1197 | ret = 0; |
| 1194 | 1198 | ||
| 1195 | err_out: | 1199 | err_out: |
| 1196 | set_cpus_allowed_ptr(current, &oldmask); | 1200 | set_cpus_allowed_ptr(current, oldmask); |
| 1201 | free_cpumask_var(oldmask); | ||
| 1197 | return ret; | 1202 | return ret; |
| 1198 | } | 1203 | } |
| 1199 | 1204 | ||
