Torfinn Ingolfsen
2013-Feb-17 12:53 UTC
RELENG_8: amdtemp module and newer CPUs not working. MFC?
Hello,
I'm running FreeBSD 8.3-stable on a machine with an AMD A8-5600K cpu.
tingo at kg-quiet$ uname -a
FreeBSD kg-quiet.kg4.no 8.3-STABLE FreeBSD 8.3-STABLE #2: Fri Jan 4 19:18:15
CET 2013
root at kg-quiet.kg4.no:/usr/obj/usr/src/sys/GENERIC amd64
tingo at kg-quiet$ dmesg | grep CPU | head -1
CPU: AMD A8-5600K APU with Radeon(tm) HD Graphics (3618.02-MHz K8-class CPU)
Unfortunately, the amdtemp.ko module doesn't work:
tingo at kg-quiet$ kldstat | grep temp
10 1 0xffffffff8123e000 f0f amdtemp.ko
tingo at kg-quiet$ sysctl dev.amdtemp
sysctl: unknown oid 'dev.amdtemp'
Based on a thread[1] on the forums, amdtemp.c from -CURRENT work.
But it doesn't compile under FreeBSD 8.3-stable:
root at kg-quiet# cd /usr/src/sys/dev/amdtemp
root at kg-quiet# ls -l /home/tingo/dl/amd*
lrwxr-xr-x 1 tingo users 25 Feb 17 13:20 /home/tingo/dl/amdtemp.c ->
amdtemp.c?revision=246128
-rw-r--r-- 1 tingo users 14509 Feb 17 13:17
/home/tingo/dl/amdtemp.c?revision=246128
root at kg-quiet# mv amdtemp.c amdtemp.c_old
root at kg-quiet# cp /home/tingo/dl/amdtemp.c .
root at kg-quiet# cd /usr/src/sys/modules/amdtemp
root at kg-quiet# make
Warning: Object directory not changed from original /usr/src/sys/modules/amdtemp
@ -> /usr/src/sys
machine -> /usr/src/sys/amd64/include
awk -f @/tools/makeobjops.awk @/kern/bus_if.m -h
awk -f @/tools/makeobjops.awk @/kern/device_if.m -h
awk -f @/tools/makeobjops.awk @/dev/pci/pci_if.m -h
cc -O2 -pipe -fno-strict-aliasing -Werror -D_KERNEL -DKLD_MODULE -nostdinc -I.
-I@ -I@/contrib/altq -finline-limit=8000 --param inline-unit-growth=100 --param
large-function-growth=1000 -fno-common -fno-omit-frame-pointer -mcmodel=kernel
-mno-red-zone -mfpmath=387 -mno-sse -mno-sse2 -mno-sse3 -mno-mmx -mno-3dnow
-msoft-float -fno-asynchronous-unwind-tables -ffreestanding -fstack-protector
-std=iso9899:1999 -fstack-protector -Wall -Wredundant-decls -Wnested-externs
-Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual
-Wundef -Wno-pointer-sign -fformat-extensions -c
/usr/src/sys/modules/amdtemp/../../dev/amdtemp/amdtemp.c
/usr/src/sys/modules/amdtemp/../../dev/amdtemp/amdtemp.c:50:28: error:
x86/pci_cfgreg.h: No such file or directory
cc1: warnings being treated as errors
/usr/src/sys/modules/amdtemp/../../dev/amdtemp/amdtemp.c: In function
'amdtemp_attach':
/usr/src/sys/modules/amdtemp/../../dev/amdtemp/amdtemp.c:314: warning: implicit
declaration of function 'pci_cfgregread'
/usr/src/sys/modules/amdtemp/../../dev/amdtemp/amdtemp.c:314: warning: nested
extern declaration of 'pci_cfgregread'
*** Error code 1
Stop in /usr/src/sys/modules/amdtemp.
Are there any plans to MFC this module?
References:
1) http://forums.freebsd.org/showthread.php?t=37775
--
Torfinn Ingolfsen <torfinn.ingolfsen at getmail.no>
On 17 Feb, Torfinn Ingolfsen wrote:> Hello, > I'm running FreeBSD 8.3-stable on a machine with an AMD A8-5600K cpu. > tingo at kg-quiet$ uname -a > FreeBSD kg-quiet.kg4.no 8.3-STABLE FreeBSD 8.3-STABLE #2: Fri Jan 4 19:18:15 CET 2013 > root at kg-quiet.kg4.no:/usr/obj/usr/src/sys/GENERIC amd64 > tingo at kg-quiet$ dmesg | grep CPU | head -1 > CPU: AMD A8-5600K APU with Radeon(tm) HD Graphics (3618.02-MHz K8-class CPU) > > Unfortunately, the amdtemp.ko module doesn't work: > tingo at kg-quiet$ kldstat | grep temp > 10 1 0xffffffff8123e000 f0f amdtemp.ko > tingo at kg-quiet$ sysctl dev.amdtemp > sysctl: unknown oid 'dev.amdtemp' > > Based on a thread[1] on the forums, amdtemp.c from -CURRENT work. > But it doesn't compile under FreeBSD 8.3-stable:Updating amdtemp is on my TODO list. It has some issues even on -CURRENT. This is kind of far down my priority list because on most of my AMD machines, I can also get the temperature without amdtemp: % sysctl hw.acpi.thermal.tz0.temperature hw.acpi.thermal.tz0.temperature: 30.0C