From nobody@FreeBSD.org  Tue Jun 24 14:44:30 2008
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D3DD91065675
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 24 Jun 2008 14:44:30 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id CB1DC8FC28
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 24 Jun 2008 14:44:30 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.2/8.14.2) with ESMTP id m5OEiUdF016972
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 24 Jun 2008 14:44:30 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.2/8.14.1/Submit) id m5OEiUx4016970;
	Tue, 24 Jun 2008 14:44:30 GMT
	(envelope-from nobody)
Message-Id: <200806241444.m5OEiUx4016970@www.freebsd.org>
Date: Tue, 24 Jun 2008 14:44:30 GMT
From: Christian Weisgerber <naddy@FreeBSD.org>
To: freebsd-gnats-submit@FreeBSD.org
Subject: Early loaded k8temp doesn't create dev.cpu.N.temperature
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         124939
>Category:       kern
>Synopsis:       [k8temp] Early loaded k8temp doesn't create dev.cpu.N.temperature
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    rpaulo
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Jun 24 14:50:01 UTC 2008
>Closed-Date:    Sat Jul 05 23:20:53 UTC 2008
>Last-Modified:  Sat Jul 05 23:20:53 UTC 2008
>Originator:     Christian Weisgerber
>Release:        FreeBSD 8.0-CURRENT
>Organization:
>Environment:
FreeBSD lorvorc.mips.inka.de 8.0-CURRENT FreeBSD 8.0-CURRENT #0: Sun Jun 22 18:49:04 CEST 2008     naddy@lorvorc.mips.inka.de:/usr/obj/usr/src/sys/GENERIC  amd64

>Description:
If the k8temp(4) driver is loaded as a module early on from
/boot/loader.conf, it fails to create the dev.cpu.N.temperature entries
in the sysctl tree.

dmesg shows this attach order:

..
k8temp0: <AMD K8 Thermal Sensors> on hostb3
acpi_hpet0: <High Precision Event Timer> iomem 0xfefff000-0xfefff3ff on acpi0
Timecounter "HPET" frequency 25000000 Hz quality 900
cpu0: <ACPI CPU> on acpi0
powernow0: <PowerNow! K8> on cpu0
cpu1: <ACPI CPU> on acpi0
powernow1: <PowerNow! K8> on cpu1
..

Apparently k8temp attaches right _before_ cpu and thus can't add its
entries to the dev.cpu subtree, which doesn't exist yet.  Note that the
dev.k8temp subtree is correctly created.

If k8temp.ko is loaded manually after the system has booted, all entries
are properly created.

>How-To-Repeat:
# echo 'k8temp_load="YES"' >>/boot/loader.conf
# reboot
..
# sysctl dev.cpu

>Fix:


>Release-Note:
>Audit-Trail:

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/124939: commit references a PR
Date: Sat,  5 Jul 2008 23:19:51 +0000 (UTC)

 rpaulo      2008-07-05 23:19:37 UTC
 
   FreeBSD src repository
 
   Modified files:
     sys/dev/k8temp       k8temp.c 
   Log:
   SVN rev 180312 on 2008-07-05 23:19:37Z by rpaulo
   
   Use config_intrhook API to create the dev.cpu.N.temperature sysctl node.
   Our hook creates the sysctl node before root is mounted, but after cpu
   is probed. It seems that k8temp can be loaded before the cpu module and,
   in those cases, dev.cpu.0.temperature was not created.
   
   PR:     124939
   
   Revision  Changes    Path
   1.5       +42 -20    src/sys/dev/k8temp/k8temp.c
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: open->closed 
State-Changed-By: rpaulo 
State-Changed-When: Sat Jul 5 23:20:06 UTC 2008 
State-Changed-Why:  
Should be fixed now. Thanks for the report. 


Responsible-Changed-From-To: freebsd-bugs->rpaulo 
Responsible-Changed-By: rpaulo 
Responsible-Changed-When: Sat Jul 5 23:20:06 UTC 2008 
Responsible-Changed-Why:  
Should be fixed now. Thanks for the report. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=124939 
>Unformatted:
