|
@@ -462,7 +462,6 @@ static int check_supported_cpu(unsigned int cpu)
|
|
|
|
|
|
oldmask = current->cpus_allowed;
|
|
|
set_cpus_allowed(current, cpumask_of_cpu(cpu));
|
|
|
- schedule();
|
|
|
|
|
|
if (smp_processor_id() != cpu) {
|
|
|
printk(KERN_ERR "limiting to cpu %u failed\n", cpu);
|
|
@@ -497,9 +496,7 @@ static int check_supported_cpu(unsigned int cpu)
|
|
|
|
|
|
out:
|
|
|
set_cpus_allowed(current, oldmask);
|
|
|
- schedule();
|
|
|
return rc;
|
|
|
-
|
|
|
}
|
|
|
|
|
|
static int check_pst_table(struct powernow_k8_data *data, struct pst_s *pst, u8 maxvid)
|
|
@@ -913,7 +910,6 @@ static int powernowk8_target(struct cpufreq_policy *pol, unsigned targfreq, unsi
|
|
|
/* only run on specific CPU from here on */
|
|
|
oldmask = current->cpus_allowed;
|
|
|
set_cpus_allowed(current, cpumask_of_cpu(pol->cpu));
|
|
|
- schedule();
|
|
|
|
|
|
if (smp_processor_id() != pol->cpu) {
|
|
|
printk(KERN_ERR "limiting to cpu %u failed\n", pol->cpu);
|
|
@@ -968,8 +964,6 @@ static int powernowk8_target(struct cpufreq_policy *pol, unsigned targfreq, unsi
|
|
|
|
|
|
err_out:
|
|
|
set_cpus_allowed(current, oldmask);
|
|
|
- schedule();
|
|
|
-
|
|
|
return ret;
|
|
|
}
|
|
|
|
|
@@ -991,12 +985,11 @@ static int __init powernowk8_cpu_init(struct cpufreq_policy *pol)
|
|
|
if (!check_supported_cpu(pol->cpu))
|
|
|
return -ENODEV;
|
|
|
|
|
|
- data = kmalloc(sizeof(struct powernow_k8_data), GFP_KERNEL);
|
|
|
+ data = kzalloc(sizeof(struct powernow_k8_data), GFP_KERNEL);
|
|
|
if (!data) {
|
|
|
printk(KERN_ERR PFX "unable to alloc powernow_k8_data");
|
|
|
return -ENOMEM;
|
|
|
}
|
|
|
- memset(data,0,sizeof(struct powernow_k8_data));
|
|
|
|
|
|
data->cpu = pol->cpu;
|
|
|
|
|
@@ -1026,7 +1019,6 @@ static int __init powernowk8_cpu_init(struct cpufreq_policy *pol)
|
|
|
/* only run on specific CPU from here on */
|
|
|
oldmask = current->cpus_allowed;
|
|
|
set_cpus_allowed(current, cpumask_of_cpu(pol->cpu));
|
|
|
- schedule();
|
|
|
|
|
|
if (smp_processor_id() != pol->cpu) {
|
|
|
printk(KERN_ERR "limiting to cpu %u failed\n", pol->cpu);
|
|
@@ -1045,7 +1037,6 @@ static int __init powernowk8_cpu_init(struct cpufreq_policy *pol)
|
|
|
|
|
|
/* run on any CPU again */
|
|
|
set_cpus_allowed(current, oldmask);
|
|
|
- schedule();
|
|
|
|
|
|
pol->governor = CPUFREQ_DEFAULT_GOVERNOR;
|
|
|
pol->cpus = cpu_core_map[pol->cpu];
|
|
@@ -1080,7 +1071,6 @@ static int __init powernowk8_cpu_init(struct cpufreq_policy *pol)
|
|
|
|
|
|
err_out:
|
|
|
set_cpus_allowed(current, oldmask);
|
|
|
- schedule();
|
|
|
powernow_k8_cpu_exit_acpi(data);
|
|
|
|
|
|
kfree(data);
|
|
@@ -1116,17 +1106,14 @@ static unsigned int powernowk8_get (unsigned int cpu)
|
|
|
set_cpus_allowed(current, oldmask);
|
|
|
return 0;
|
|
|
}
|
|
|
- preempt_disable();
|
|
|
-
|
|
|
+
|
|
|
if (query_current_values_with_pending_wait(data))
|
|
|
goto out;
|
|
|
|
|
|
khz = find_khz_freq_from_fid(data->currfid);
|
|
|
|
|
|
- out:
|
|
|
- preempt_enable_no_resched();
|
|
|
+out:
|
|
|
set_cpus_allowed(current, oldmask);
|
|
|
-
|
|
|
return khz;
|
|
|
}
|
|
|
|