From owner-svn-src-head@FreeBSD.ORG Mon Sep 14 16:29:36 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by hub.freebsd.org (Postfix) with ESMTP id 938491065676; Mon, 14 Sep 2009 16:29:35 +0000 (UTC) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: Kris Kennaway Date: Mon, 14 Sep 2009 12:29:20 -0400 User-Agent: KMail/1.6.2 References: <200909112147.n8BLlind064388@svn.freebsd.org> <4AAD19F2.10005@FreeBSD.org> In-Reply-To: <4AAD19F2.10005@FreeBSD.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: Multipart/Mixed; boundary="Boundary-00=_i9mrKA/ROv5TzfR" Message-Id: <200909141229.23229.jkim@FreeBSD.org> Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r197102 - head/sys/dev/amdtemp X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Sep 2009 16:29:36 -0000 --Boundary-00=_i9mrKA/ROv5TzfR Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline On Sunday 13 September 2009 12:12 pm, Kris Kennaway wrote: > Jung-uk Kim wrote: > > Author: jkim > > Date: Fri Sep 11 21:47:44 2009 > > New Revision: 197102 > > URL: http://svn.freebsd.org/changeset/base/197102 > > > > Log: > > Improve amdtemp(4) significantly: > > > > - Improve newer AMD processor support (Family 0Fh Revision F > > and later). - Adjust offset if DiodeOffet is set and valid. Note > > it is experimental but it seems to give us more realistic > > temperatures. Newer Linux driver blindly adds 21C for Family 0Fh > > desktop processors, however. - Always populate dev.cpu and > > dev.amdtemp sysctl trees regardless of probe order for > > consistency. Previously, dev.cpu.N.temperature was not populated > > if amdtemp was loaded later than ACPI CPU driver and temperatures > > were not accessible from dev.amdtemp.N.sensor0 tree for Family > > 10h/11h processors. - Read the CPUID from PCI register instead of > > CPUID instruction to prevent possible revision mismatches on > > multi-socket system. > > - Change macros and variables to make them closer to AMD > > documents. - Fix style(9) nits and improve comments. > > It no longer appears to work for me. The old version reported: > > dev.amdtemp.0.%desc: AMD K8 Thermal Sensors > dev.amdtemp.0.%driver: amdtemp > dev.amdtemp.0.%parent: hostb9 > dev.amdtemp.0.sensor0.core0: 38.0C > dev.amdtemp.0.sensor0.core1: 45.0C > dev.amdtemp.0.sensor1.core0: 38.0C > dev.amdtemp.0.sensor1.core1: 45.0C > dev.cpu.0.temperature: 38.0C > dev.cpu.1.temperature: 38.0C > > but none of those sysctl nodes are now present. > > CPU: AMD Athlon(tm) 64 X2 Dual Core Processor 4600+ (2400.10-MHz > K8-class CPU) > Origin = "AuthenticAMD" Id = 0x20f32 Stepping = 2 > > Features=0x178bfbffR,PGE,MCA,CMOV,PAT,PSE36,CLFLUSH,MMX,FXSR,SSE,SSE2,HTT> > Features2=0x1 > AMD Features=0xe2500800 > AMD Features2=0x3 > ACPI APIC Table: Arg... This is a Socket 939, Revision E processor and Revision C/D/E seems to have different DiodeOffset encoding. Please try the attached patch until I fix it properly. Sorry for the inconvenience. Jung-uk Kim --Boundary-00=_i9mrKA/ROv5TzfR Content-Type: text/plain; charset="iso-8859-1"; name="amdtemp.c.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="amdtemp.c.diff" --- sys/dev/amdtemp/amdtemp.c +++ sys/dev/amdtemp/amdtemp.c @@ -185,13 +185,6 @@ amdtemp_probe(device_t dev) break; case 0x10: case 0x11: - /* - * DiodeOffset must be non-zero if thermal diode is supported. - */ - temp = pci_read_config(dev, AMDTEMP_THERMTP_STAT, 4); - temp = (temp >> 8) & 0x7f; - if (temp == 0) - return (ENXIO); break; default: return (ENXIO); --Boundary-00=_i9mrKA/ROv5TzfR--