kernel - Switch to exclusive spinlocks in the coretemp sensor
authorMatthew Dillon <dillon@apollo.backplane.com>
Mon, 30 Aug 2010 06:20:12 +0000 (23:20 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Mon, 30 Aug 2010 06:20:12 +0000 (23:20 -0700)
* No impact on performance.

* TODO: spinlocks are being held across major kernel calls in the
  detach code which is not legal.

sys/dev/powermng/coretemp/coretemp.c

index 65dbac7..58564bd 100644 (file)
@@ -225,9 +225,9 @@ coretemp_get_temp(device_t dev)
                origcpu = mycpuid;
                lwkt_migratecpu(cpu);
 
-               spin_lock_rd(&coretemp_lock);
+               spin_lock_wr(&coretemp_lock);
                msr = rdmsr(MSR_THERM_STATUS);
-               spin_unlock_rd(&coretemp_lock);
+               spin_unlock_wr(&coretemp_lock);
 
                lwkt_migratecpu(origcpu);
        } else if (cpu != 0)