Henrik Brix Andersen <[EMAIL PROTECTED]> writes:
> $ dmesg | grep coretemp
> coretemp0: <CPU On-Die Thermal Sensors> on cpu0
> coretemp1: <CPU On-Die Thermal Sensors> on cpu1
>
> $ sysctl dev.cpu.0.temperature
> dev.cpu.0.temperature: -50
>
> $ sysctl dev.cpu.1.temperature
> dev.cpu.1.temperature: -49

This means Tj(max) is not properly detected.  The CPU actually reports
the temperature as a delta from the maximum rated operating temperature
in degrees Celsius; you're seeing the raw value.

Actually, the bug is easy to see:

        if ((cpu_model == 0xf && cpu_mask > 3) || cpu_model == 0xe) {
                msr = rdmsr(MSR_IA32_EXT_CONFIG);
                if ((msr >> 30) & 0x1)
                        sc->sc_tjmax = 85;
        } else
                sc->sc_tjmax = 100;

Initializing sc->sc_tjmax to 100 before the outer if test should fix
this.  Could you please test the attached patch?

> The ACPI thermal zones seem to provide much more realistic readings:
>
> $ sysctl hw.acpi.thermal.tz0.temperature
> hw.acpi.thermal.tz0.temperature: 65.0C
>
> $ sysctl hw.acpi.thermal.tz1.temperature
> hw.acpi.thermal.tz1.temperature: 67.0C

Those are not the same temperature sensors.  The actual temperature in
your CPU is around 50 degrees Celsius.  The ACPI thermal zones are
probably sensors on the motherboard.

DES
-- 
Dag-Erling Smørgrav - [EMAIL PROTECTED]

Index: sys/dev/coretemp/coretemp.c
===================================================================
RCS file: /home/ncvs/src/sys/dev/coretemp/coretemp.c,v
retrieving revision 1.1
diff -u -r1.1 coretemp.c
--- sys/dev/coretemp/coretemp.c	15 Aug 2007 19:26:02 -0000	1.1
+++ sys/dev/coretemp/coretemp.c	15 Aug 2007 21:35:31 -0000
@@ -168,12 +168,12 @@
 	 * The if-clause for CPUs having the MSR_IA32_EXT_CONFIG was adapted
 	 * from the Linux coretemp driver.
 	 */
+	sc->sc_tjmax = 100;
 	if ((cpu_model == 0xf && cpu_mask > 3) || cpu_model == 0xe) {
 		msr = rdmsr(MSR_IA32_EXT_CONFIG);
-		if ((msr >> 30) & 0x1)
+		if (msr & (1 << 30))
 			sc->sc_tjmax = 85;
-	} else
-		sc->sc_tjmax = 100;
+	}
 		
 	/*
 	 * Add the "temperature" MIB to dev.cpu.N.
_______________________________________________
cvs-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to