Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 245459 - sys-apps/lm_sensors-2.10.7 not always reading sensors on recent 2.6 kernels
Summary: sys-apps/lm_sensors-2.10.7 not always reading sensors on recent 2.6 kernels
Status: RESOLVED UPSTREAM
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Mobile Herd (OBSOLETE)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-11-04 00:41 UTC by Matthew Stapleton
Modified: 2009-06-07 14:44 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
lm_sensors_2_read.patch (lm_sensors_2_read.patch,1007 bytes, patch)
2008-11-04 00:47 UTC, Matthew Stapleton
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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...