summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_cpu.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/kern/kern_cpu.c')
-rw-r--r--sys/kern/kern_cpu.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/sys/kern/kern_cpu.c b/sys/kern/kern_cpu.c
index 3d2adfd..6a72b9c 100644
--- a/sys/kern/kern_cpu.c
+++ b/sys/kern/kern_cpu.c
@@ -298,17 +298,17 @@ cf_set_method(device_t dev, const struct cf_level *level, int priority)
cpu_id = PCPU_GET(cpuid);
pc = cpu_get_pcpu(set->dev);
if (cpu_id != pc->pc_cpuid) {
- mtx_lock_spin(&sched_lock);
+ thread_lock(curthread);
sched_bind(curthread, pc->pc_cpuid);
- mtx_unlock_spin(&sched_lock);
+ thread_unlock(curthread);
}
CF_DEBUG("setting abs freq %d on %s (cpu %d)\n", set->freq,
device_get_nameunit(set->dev), PCPU_GET(cpuid));
error = CPUFREQ_DRV_SET(set->dev, set);
if (cpu_id != pc->pc_cpuid) {
- mtx_lock_spin(&sched_lock);
+ thread_lock(curthread);
sched_unbind(curthread);
- mtx_unlock_spin(&sched_lock);
+ thread_unlock(curthread);
}
if (error) {
goto out;
@@ -327,17 +327,17 @@ cf_set_method(device_t dev, const struct cf_level *level, int priority)
cpu_id = PCPU_GET(cpuid);
pc = cpu_get_pcpu(set->dev);
if (cpu_id != pc->pc_cpuid) {
- mtx_lock_spin(&sched_lock);
+ thread_lock(curthread);
sched_bind(curthread, pc->pc_cpuid);
- mtx_unlock_spin(&sched_lock);
+ thread_unlock(curthread);
}
CF_DEBUG("setting rel freq %d on %s (cpu %d)\n", set->freq,
device_get_nameunit(set->dev), PCPU_GET(cpuid));
error = CPUFREQ_DRV_SET(set->dev, set);
if (cpu_id != pc->pc_cpuid) {
- mtx_lock_spin(&sched_lock);
+ thread_lock(curthread);
sched_unbind(curthread);
- mtx_unlock_spin(&sched_lock);
+ thread_unlock(curthread);
}
if (error) {
/* XXX Back out any successful setting? */
OpenPOWER on IntegriCloud