Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 245459

Summary: sys-apps/lm_sensors-2.10.7 not always reading sensors on recent 2.6 kernels
Product: Gentoo Linux Reporter: Matthew Stapleton <matthew4196>
Component: Current packagesAssignee: Mobile Herd (OBSOLETE) <mobile+disabled>
Status: RESOLVED UPSTREAM    
Severity: normal CC: armin76
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: lm_sensors_2_read.patch

Description Matthew Stapleton 2008-11-04 00:41:05 UTC
The current way lm_sensors reads sensor info from sysfs currently doesn't always work on recent 2.6 kernels due to way the if tests in the sensors_init function seem to interact with gcc optimisations.  This problem appears if there are entries in the hwmon sysfs directory but not the i2c-adapter sysfs directory.


Reproducible: Sometimes

Steps to Reproduce:
1. Configure lm_sensors and net-snmp for sensor monitoring
2. Check /sys/class/i2c-adapter/ to make sure there are no entries
3. Check /sys/class/hwmon/ to make sure there are sensor entries
4. Run sensors
5. Start snmpd and run snmpwalk -v 2c -c <community> 127.0.0.1 .1.3.6.1.4.1.2021.13.16

Actual Results:  
lm_sensors shows the sensors output but net-snmp doesn't detect any sensors

Expected Results:  
both lm_sensors and net-snmp should detect and show all the sensors

This was tested with net-analyzer/net-snmp-5.4.1.1, sys-apps/sensors-2.10.7, and kernel: 2.6.26-hardened-r1 with sensor module: w83627ehf
Comment 1 Matthew Stapleton 2008-11-04 00:47:55 UTC
Created attachment 170659 [details, diff]
lm_sensors_2_read.patch

This patch attempts to fix the problem by not assigning the result of both the bus reading and chip reading functions to the same variable and by reading both sensor types before checking the result.
Comment 2 Raúl Porcel (RETIRED) gentoo-dev 2009-01-03 15:43:47 UTC
Did you send this upstream?
Comment 3 Matthew Stapleton 2009-01-23 07:58:03 UTC
No
Comment 4 Raúl Porcel (RETIRED) gentoo-dev 2009-02-19 19:37:42 UTC
Please do...