Subject: kern/36226: envsys(4) drivers shouldn't refresh all sensors in gtredata
To: None <kern-bug-people@netbsd.org, gnats-admin@netbsd.org,>
From: None <juan@xtrarom.org>
List: netbsd-bugs
Date: 04/26/2007 21:20:00
>Number:         36226
>Category:       kern
>Synopsis:       envsys(4) drivers shouldn't refresh all sensors in gtredata
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Apr 26 21:20:00 +0000 2007
>Originator:     Juan RP
>Release:        NetBSD 4.99.18
>Organization:
>Environment:
System: NetBSD nocturno 4.99.18 NetBSD 4.99.18 (Nocturno) #126: Thu Apr 26 23:01:01 CEST 2007 juan@nocturno:/home/juan/build/src/obj/sys/arch/amd64/compile/Nocturno amd64
Architecture: x86_64
Machine: amd64
>Description:
	Many envsys(4) drivers assume that in foo_gtredata they should
	update all sensors (ignoring sensor's index), but this is wrong
	because only one sensor should be updated by this function callback,
	the index is set in envsys_tre_data_t->sensor.

	That means that if a driver updates 12 sensors in gtredata, will
	update the sensors n^2. I verified this behaviour with aiboost(4)
	and lm(4), and I fixed them to only update onse sensor per gtredata
	call.

>How-To-Repeat:
	Code inspection.
>Fix:
	I have fixed aiboost(4) and lm(4), more drivers to follow.