Skip to contentSkip to conversation

Ticket 1552

DISCUSSION Jean Delvare 3 participants 12 messages May 19, 2005

lore
Share & tools
lore
#1 lore raw

[Please CC: the mailing-list on reply.]

Quoting "J. Bolt" <[email protected]>:

Quoted 5 lines
james@plutonium:/usr/src$ sensors
w83l785ts-i2c-1-2e
Adapter: SMBus nForce2 adapter at 5500
temp: 49.00 (temp)
  temp_over: 110.00 (temp_over)

Uh-oh. Should display better than that. Patch against lm_sensors 2.8.3 attached. Care to give it a try?

I'm also a bit surprised that temp_over is 110 degrees C. According to the data sheet, only two values are possible: 85 and 100. I don't give much credit to that data sheet, still I'd like to take a closer look to your chip, if you don't mind. "i2cdump 1 0x2e" (after unloading the w83l785ts driver) should provide the information I am after. You'll probably notice XX's in the dump. See below.

Quoted 8 lines

asb100-i2c-1-2d
Adapter: SMBus nForce2 adapter at 5500
VCore 1: +1.76 V (min = +1.63 V, max = +1.81 V)

+3.3V:     +3.17 V  (min =  +3.12 V, max =  +3.46 V)
+5V:       +4.87 V  (min =  +4.73 V, max =  +5.24 V)
+12V:     +11.49 V  (min = +10.76 V, max = +13.19 V)
-12V:     -12.01 V  (min =  -0.00 V, max =  -0.00 V)
-5V:       -5.04 V  (min =  -0.00 V, max =  -0.00 V)

No min/max limits set for -12V/-5V?

Quoted 1 line

cpu_fan: 4824 RPM (min = 1225 RPM, div = 4)

I would set the fan_div to 2 and raise the min to 3000.

Quoted 3 lines
big_fan:  2033 RPM  (min = 1896 RPM, div = 4)
psu_fan:  1722 RPM  (min = 1454 RPM, div = 4)
mb_temp:     +19?C  (high =    +0?C, hyst =    +0?C)

No limits here either? BTW, this is a very very low temperature you have
here. Where is that system living?

Quoted 6 lines
cpu_temp:    +44?C  (high =   +60?C, hyst =   +65?C)
vid:      +1.725 V

alarms:

Patched fine to 2.6.2, seems to work fine. Does rarely show "-1", although I'm sure that's the fault of the chip itself.

More or less. Other users have reported the problem as well. This is caused by the driver being unable to read the temperature register, probably because of a bus collision. Maybe your system logs show something of that kind? Probably Asus' COP feature accesses the chip in our back and causes the trouble, but it doesn't seem to be something we can disable, so we'll have to cope (ah ah) with it.

Simply returning -1 isn't nice from us, nevertheless. There are several other things that could be done:
- Notify the error (i.e. reading from the sysfs file returns an error), then return the last known good value, if we have one.
- Retry reading the register until we succeed or reach a limit count.

We usually ignore read errors in chip drivers because they are rare, but since it happens so frequently with that specific chip, we will have to do it here. I will try to implement the solutions listed above, if you want to help me test them.

Signature · 10 lines
Jean Delvare
http://www.ensicaen.ismra.fr/~delvare/

-------------- next part --------------
A non-text attachment was scrubbed...
Name: sensors-2.8.3-w83l785ts.diff
Type: application/octet-stream
Size: 418 bytes
Desc: not available
Url : http://lists.lm-sensors.org/pipermail/lm-sensors/attachments/20040202/39de2d43/sensors-2.8.3-w83l785ts.obj
#2 lore raw
In reply to Jean Delvare

[Please CC: the mailing-list on reply.]

Quoting myself:

Quoted 4 lines

We usually ignore read errors in chip drivers because they are rare, but since it happens so frequently with that specific chip, we will have to do it here. I will try to implement the solutions listed above, if you want to help me test them.

Here is a patch, tested to apply and compile on Linux 2.6.2-rc3. Could you please give it a try? It should solve the rare "-1" readings problem, as well as possible misdetection issues.

If the driver is really unable to read a register value, it will silently return the previously known value (or 0 if it doesn't have one yet). Maybe we could log the incident, although I'm fairly certain it will never happen, providing the number of max retries is high enough (I set it to 5 for now).

Thanks.

Signature · 10 lines
Jean Delvare
http://www.ensicaen.ismra.fr/~delvare/

-------------- next part --------------
A non-text attachment was scrubbed...
Name: linux-2.6.2-rc3-i2c-w83l785ts-retries.diff
Type: application/octet-stream
Size: 3342 bytes
Desc: not available
Url : http://lists.lm-sensors.org/pipermail/lm-sensors/attachments/20040202/ca50f495/linux-2.6.2-rc3-i2c-w83l785ts-retries.obj
#3 lore raw
In reply to Jean Delvare

Quoting "J. Bolt" <[email protected]>:

Quoted 16 lines

I applied the patch to 2.6.2-rc3 and wrote a simple perl script to test the output of sensors:

Executing 50 tests of diode output
(Checking every 3 seconds)
[50] +48?C
[49] +51?C
[48] +54?C
[47] +50?C
[46] +51?C
[45] +51?C
[44] +52?C
[43] +49?C
[42] +51?C
[41] +52?C
(...)

Looks good. The rather fast variations are expected since the thermal diode is inside the CPU itself.

Quoted 2 lines

Executing 20 tests of diode output
(Checking every 1 seconds)

Note that the driver caches the data for 2 seconds anyway, so you can't see changes faster than that. This explains why you see pairs of identical values in the following list:

Quoted 12 lines

[20] +49?C
[19] +49?C
[18] +48?C
[17] +48?C
[16] +51?C
[15] +51?C
[14] +52?C
[13] +52?C
[12] +51?C
[11] +51?C
(...)

Quoted 1 line

Hope that's off some use, haven't had any "-1" values,

Thanks for testing. Since the new driver hides the errors as it "corrects" them, there's no easy way to know how useful the improved (or should I call it insisting) read method is. I really think we should make it more verbose.

Could you please apply the attached patch (on top of the previous one) and recompile the w83l785ts driver with DEBUG enabled? No need to recompile the whole kernel, just updating the w83l785ts module should do it. Running your test script should then trigger the debug log (and possibly the error log but I doubt it). I wonder how frequently the retry will be necessary, and wether you'll sometimes need more than one retry.

I would appreciate it much if you could let your script run long enough to have some solid statistics about the phenomenon.

Thanks.

Signature · 10 lines
Jean Delvare
http://www.ensicaen.ismra.fr/~delvare/

-------------- next part --------------
A non-text attachment was scrubbed...
Name: linux-2.6.2-rc3-i2c-w83l785ts-debug.diff
Type: application/octet-stream
Size: 480 bytes
Desc: not available
Url : http://lists.lm-sensors.org/pipermail/lm-sensors/attachments/20040202/9e0f5550/linux-2.6.2-rc3-i2c-w83l785ts-debug.obj
#4 lore raw
In reply to Jean Delvare

Quoting Mark Studebaker <[email protected]>:

Quoted 2 lines

Back in late 2002/Jan. '03 we had a lot of discussion about read errors.

I think I remember reading it.

Quoted 2 lines

Certainly the situation then and now, where most drivers just return a -1, isn't great.

Sure, that's not fine at all. That -1 is then converted to bogus temperatures, voltages, whatever. Could have unsuspected consequences.

Quoted 3 lines

One sentiment was that drivers definitely shouldn't silently return the old value, that definitely wasn't "server-class". People felt strongly about this.

I agree too. If nothing else, the error should at least be logged. But it would of course be better to let the user-space know about the problem.

Quoted 6 lines

So what I did back then was update the adm1021 driver as a demonstration.
This was just after it got ported to 2.6, so my changes are only in our package, not 2.6.
This driver now sets the appropriate alarms bit on a read failure, and returns the old value. Take a look.

Interesting. I didn't know you did that, must have occured before I started working actively on the project. The idea isn't bad, but I don't like much using a value for something else than its original meaning. Two drawbacks I can think of: user-space cannot differenciate between real alarms and read errors, and the alarms value doesn't match the register(s) anymore.

Quoted 3 lines

I think at the time I also proposed a new /proc entry, similar to alarms and with the same bitmask, called 'fail'. This would provide an indication separate from the alarm indication.

I like that idea even more, although it has some caveats to be discussed. For example, what about registers that do not have an alarm bit?

Quoted 3 lines

I'm sure there are other ways... perhaps sysfs opens some new possibilities.
Any way to make the sysfs read fail, for example?

Not with the current structure of the drivers AFAICT. Since any procfs/sysfs read attempt updates all registers (except for a very few drivers), you cannot easily know which register failed, unless you keep track of it. This would require either one "valid" boolean for each register, or even one additional "last_updated" value for each register (in which case we get rid of the global update concept). This means a greater complexity of the driver (same idea as what I did for the eeprom driver, but with a one-byte granularity) but possibly increased responsiveness and lessened collision probabilities.

I am not sure such changes are required to solve the read errors. If we leave the w83l785ts apart, read errors are most likely caused by dying or badly designed hardware. Logging the error and returning the previous value or retrying to read may be considered sufficent and doesn't require much change in the code, as you can see with my recent patch to the w83l785ts driver.

That said, the w83l785ts is a slightly different case, since the errors are obviously caused by a design issue (well, in a way, we can call it badly designed hardware as well). Read errors happen to (almost?) all A7N8X owners, and more frequently than what one would call rarely (15% of the time as James' stats showed). This is why I implemented my insisting-read method in this driver.

Write errors, on the other hand, can already be easily reported by sysfs, as Reinhard Nissl demonstrated while porting the fscher driver.

Signature · 2 lines
Jean Delvare
http://www.ensicaen.ismra.fr/~delvare/
#5 lore raw
In reply to Jean Delvare
james@plutonium:/usr/src$ sensors
w83l785ts-i2c-1-2e
Adapter: SMBus nForce2 adapter at 5500
temp: 49.00 (temp)
  temp_over: 110.00 (temp_over)

asb100-i2c-1-2d
Adapter: SMBus nForce2 adapter at 5500
VCore 1: +1.76 V (min = +1.63 V, max = +1.81 V)

+3.3V:     +3.17 V  (min =  +3.12 V, max =  +3.46 V)
+5V:       +4.87 V  (min =  +4.73 V, max =  +5.24 V)
+12V:     +11.49 V  (min = +10.76 V, max = +13.19 V)
-12V:     -12.01 V  (min =  -0.00 V, max =  -0.00 V)
-5V:       -5.04 V  (min =  -0.00 V, max =  -0.00 V)
cpu_fan:  4824 RPM  (min = 1225 RPM, div = 4)
big_fan:  2033 RPM  (min = 1896 RPM, div = 4)
psu_fan:  1722 RPM  (min = 1454 RPM, div = 4)
mb_temp:     +19?C  (high =    +0?C, hyst =    +0?C)
cpu_temp:    +44?C  (high =   +60?C, hyst =   +65?C)

vid: +1.725 V
alarms:

Patched fine to 2.6.2, seems to work fine. Does rarely show "-1", although I'm sure that's the fault of the chip itself.

Many thanks, problem solved :)

J. Bolt

Quoted 6 lines · you

Hi James,

I have a patch for you:
http://delvare.nerim.net/i2c/linux-2.6/linux-2.6.2-rc3-i2c-w83l785ts-temp-s
ysfs.diff

Quoted 7 lines

It applies against a recent 2.6 kernel and should solve the problem you reported in ticket 1552.

If you confirm it works for you, I'll send it to Greg KH for inclusion into the Linux kernel tree.

Thanks.

-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1.2.4 (GNU/Linux)

mQGiBD7s3PIRBAC2KWjpIG0YfRLgIHUxBrFQmTiIq0yQlaBa7vgjSkKroEtvSjBS sk5N9NE0y92rGa7C2pfG0w1/rmEghyTLRRfUKyXAnLr/jE6QEnT4yIN+4mRodwZg bDlSML0AQ09JUv+QBidGtd1kH01lvRdnbCvsMyMNmsp6ryS6pneRKJQ7AwCgyR5I 0rkR4s+sGE3OIfgkw2z5PIUEAKST5r8Lg07T4FSWdOE/EtwX3Xe4vWGBayZKHh0t A2U8IbaMMLhVHk9g7c3jZ6ptIJqY3yWpp26A+kZNTk53wohnmawtLFEs1HLgFeRc ppJMNB7TgpyVWUTTYLtZ5GCeA4A67Iq8+CaqX4Tf7Dq1X9dgyUR+b64ajJFd/igt F/TQA/9zemvSCw1iGgjK+X3WCiAmeYpI9CT6r+XcNkjNI07EpcJyb6upsClLPgqr Gpc5O6fv+1zmD409xwTi/1QykogkyeYoNbMVnG35ZQ2K5702HA9ZF6lWXLNU3Rho /q8nRnqgpj8re6koAiQZfNatEAD5x0zktEfWC4N6DQDUCM9RdrQiSmFtZXMgQm9s dCA8amFtZXNAZXZpbHBlbmd1aW4uY29tPohXBBMRAgAXBQI+7NzyBQsHCgMEAxUD AgMWAgECF4AACgkQzRkMO5+4Zu3ljQCfVCXWrTxkP1UdtYe+Kfa/4w4h0SAAoI0o QYXKsXvXHDDw1GgxAD4DvH+1uQENBD7s3PIQBADQkIB2Ml9tAPNOk1BhbdpSF1oM 8XYkHpzA8IviczaDqr/ArSPfbkoxyDr165T+hhqGx+zhQSpJ2re7L4tsLpZvojUW LEH65rUZ5OJNKUt4ayAM3MFMZFLfZoUSQoqjkZOvJSZQJGCA6lKTtYnLglJdS7vv DrqZbHjZIqDlCuHkFwADBQQAiuP4Wfmg950F/UJ4zbup5jn/ABnMasUbd3dmnK5F nNNiWhE7l4/oEh2zgF6g+3qT9s/7m77nn/ccheuA7TTeO82uLiqWdmde8+l+RMpp rCa4Gr4bAN5OLzr85dcd31mepYw7CmQG3iiKUCHgSxuBvlR8MXWaWnei3VQPCHeo veqIRgQYEQIABgUCPuzc8gAKCRDNGQw7n7hm7ZQjAJ0faoGh6Eq4WSxYk1xMf4rC 6/IehwCdH/Tq0Yjis8PDCKZiIKJlqHkJfiE=r11q
-----END PGP PUBLIC KEY BLOCK-----

#6 lore raw
In reply to Jean Delvare
Quoted 12 lines · you

[Please CC: the mailing-list on reply.]

Quoting "J. Bolt" <[email protected]>:

Quoted 5 lines
james@plutonium:/usr/src$ sensors
w83l785ts-i2c-1-2e
Adapter: SMBus nForce2 adapter at 5500
temp: 49.00 (temp)
  temp_over: 110.00 (temp_over)

Uh-oh. Should display better than that. Patch against lm_sensors 2.8.3 attached. Care to give it a try?

Ok, applied.

w83l785ts-i2c-1-2e
Adapter: SMBus nForce2 adapter at 5500
Algorithm: Unavailable from sysfs
temp: +51?C (high = +110?C)

Quoted 7 lines

I'm also a bit surprised that temp_over is 110 degrees C. According to the data sheet, only two values are possible: 85 and 100. I don't give much credit to that data sheet, still I'd like to take a closer look to your chip, if you don't mind. "i2cdump 1 0x2e" (after unloading the w83l785ts driver) should provide the information I am after. You'll probably notice XX's in the dump. See below.

root@plutonium:/etc/rc.d# i2cdump 1 0x2e
No size specified (using byte-data access)
  WARNING! This program can confuse your I2C bus, cause data loss and worse!
  I will probe file /dev/i2c-1, address 0x2e, mode byte
  You have five seconds to reconsider and press CTRL-C!
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f    0123456789abcdef
00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
10: ff ff ff ff XX ff ff ff ff ff ff ff ff ff ff ff    ....X...........
20: 35 36 00 00 00 00 5c 35 00 00 00 ff 00 ff 00 00    56....\5........
30: 00 00 00 00 00 00 00 50 4b 50 4b 00 00 00 00 00    .......PKPK.....
40: 0d 00 00 00 00 80 ff ff ff ff ff ff a3 5c 70 ff    ?....?......?\p.
50: 06 04 03 6e 7f 4b 46 4b 46 00 fa bc ff ff ff ff    ???n?KFKF.??....
60: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
70: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
80: ff ff ff ff ff 00 18 ff ff ff ff ff ff ff ff ff    ......?.........
90: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
a0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
b0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
c0: ff ff XX ff ff ff ff ff ff ff ff ff ff ff ff ff    ..X.............
d0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
e0: c9 02 3a 71 39 38 37 33 ff ff ff ff ff ff ff ff    ??:q9873........
f0: ff 2e 00 ff 00 65 00 ff 00 00 ff 00 00 02 ff ff    .....e.......?..

(also @ http://james.evilpenguin.com/i2cdump.png)

Quoted 11 lines
Quoted 8 lines

asb100-i2c-1-2d
Adapter: SMBus nForce2 adapter at 5500
VCore 1: +1.76 V (min = +1.63 V, max = +1.81 V)

+3.3V:     +3.17 V  (min =  +3.12 V, max =  +3.46 V)
+5V:       +4.87 V  (min =  +4.73 V, max =  +5.24 V)
+12V:     +11.49 V  (min = +10.76 V, max = +13.19 V)
-12V:     -12.01 V  (min =  -0.00 V, max =  -0.00 V)
-5V:       -5.04 V  (min =  -0.00 V, max =  -0.00 V)

No min/max limits set for -12V/-5V?

I have a problem w/ min/max limits in general since using the asb100 driver instead of as99127f. It seems that the hyst/over values aren't retrieved properly from my sensors.conf. E.g.

label temp1 "mb_temp"
set temp1_over 45
set temp1_hyst 40

mb_temp: +21?C (high = +0?C, hyst = +0?C)

Although it doesn't affect everything

label temp2 "cpu_temp"
set temp2_over 65
set temp2_hyst 60

cpu_temp: +46?C (high = +60?C, hyst = +65?C)

I seem to have the same problem w/ some of the voltage settings (not getting the -5v & -12v max/min values)

    label in5 "-12V"
    compute in5 -@ * 3.97 ,  -@ / 3.97
    set in5_max -12 * 0.90
    set in5_min -12 * 1.10

I've attached the asb100-* extract from my sensors.conf file for reference.

Quoted 4 lines
Quoted 1 line

cpu_fan: 4824 RPM (min = 1225 RPM, div = 4)

I would set the fan_div to 2 and raise the min to 3000.

It's a variable speed smartfan (runs between 1300 & 4800RPM). It seems to work best with a divider of 4 and "compute fan1 @/2.12, 2*@".

Quoted 8 lines
Quoted 3 lines
big_fan:  2033 RPM  (min = 1896 RPM, div = 4)
psu_fan:  1722 RPM  (min = 1454 RPM, div = 4)
mb_temp:     +19?C  (high =    +0?C, hyst =    +0?C)

No limits here either? BTW, this is a very very low temperature you have
here. Where is that system living?

See above for my limits problem. The 19C value is the same as reported by the BIOS. It's only about 21 degC in here at the moment & I'm pretty sure my large fan is blowing on the air temp sensor. On cutting the fan it rises in to the low 20s.

Quoted 11 lines
Quoted 6 lines
cpu_temp:    +44?C  (high =   +60?C, hyst =   +65?C)
vid:      +1.725 V

alarms:

Patched fine to 2.6.2, seems to work fine. Does rarely show "-1", although I'm sure that's the fault of the chip itself.

More or less. Other users have reported the problem as well. This is caused by the driver being unable to read the temperature register, probably because of a bus collision. Maybe your system logs show something of that kind?

Nothing logged, I'll enabled some of the CONFIG_I2C_DEBUG_* options when I move from kernel 2.6.2-rc2 to rc3 to apply your linux-2.6.2-rc3-i2c-w83l785ts-retries.diff patch.

Quoted 10 lines

Probably Asus' COP feature accesses the chip in
our back and causes the trouble, but it doesn't seem to be something we can disable, so we'll have to cope (ah ah) with it.

Simply returning -1 isn't nice from us, nevertheless. There are several other things that could be done:
- Notify the error (i.e. reading from the sysfs file returns an error), then return the last known good value, if we have one.
- Retry reading the register until we succeed or reach a limit count.

Quoted 4 lines

We usually ignore read errors in chip drivers because they are rare, but since it happens so frequently with that specific chip, we will have to do it here. I will try to implement the solutions listed above, if you want to help me test them.

Will apply that patch in a second...

J. Bolt

Signature · 95 lines
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1.2.4 (GNU/Linux)

mQGiBD7s3PIRBAC2KWjpIG0YfRLgIHUxBrFQmTiIq0yQlaBa7vgjSkKroEtvSjBS
sk5N9NE0y92rGa7C2pfG0w1/rmEghyTLRRfUKyXAnLr/jE6QEnT4yIN+4mRodwZg
bDlSML0AQ09JUv+QBidGtd1kH01lvRdnbCvsMyMNmsp6ryS6pneRKJQ7AwCgyR5I
0rkR4s+sGE3OIfgkw2z5PIUEAKST5r8Lg07T4FSWdOE/EtwX3Xe4vWGBayZKHh0t
A2U8IbaMMLhVHk9g7c3jZ6ptIJqY3yWpp26A+kZNTk53wohnmawtLFEs1HLgFeRc
ppJMNB7TgpyVWUTTYLtZ5GCeA4A67Iq8+CaqX4Tf7Dq1X9dgyUR+b64ajJFd/igt
F/TQA/9zemvSCw1iGgjK+X3WCiAmeYpI9CT6r+XcNkjNI07EpcJyb6upsClLPgqr
Gpc5O6fv+1zmD409xwTi/1QykogkyeYoNbMVnG35ZQ2K5702HA9ZF6lWXLNU3Rho
/q8nRnqgpj8re6koAiQZfNatEAD5x0zktEfWC4N6DQDUCM9RdrQiSmFtZXMgQm9s
dCA8amFtZXNAZXZpbHBlbmd1aW4uY29tPohXBBMRAgAXBQI+7NzyBQsHCgMEAxUD
AgMWAgECF4AACgkQzRkMO5+4Zu3ljQCfVCXWrTxkP1UdtYe+Kfa/4w4h0SAAoI0o
QYXKsXvXHDDw1GgxAD4DvH+1uQENBD7s3PIQBADQkIB2Ml9tAPNOk1BhbdpSF1oM
8XYkHpzA8IviczaDqr/ArSPfbkoxyDr165T+hhqGx+zhQSpJ2re7L4tsLpZvojUW
LEH65rUZ5OJNKUt4ayAM3MFMZFLfZoUSQoqjkZOvJSZQJGCA6lKTtYnLglJdS7vv
DrqZbHjZIqDlCuHkFwADBQQAiuP4Wfmg950F/UJ4zbup5jn/ABnMasUbd3dmnK5F
nNNiWhE7l4/oEh2zgF6g+3qT9s/7m77nn/ccheuA7TTeO82uLiqWdmde8+l+RMpp
rCa4Gr4bAN5OLzr85dcd31mepYw7CmQG3iiKUCHgSxuBvlR8MXWaWnei3VQPCHeo
veqIRgQYEQIABgUCPuzc8gAKCRDNGQw7n7hm7ZQjAJ0faoGh6Eq4WSxYk1xMf4rC
6/IehwCdH/Tq0Yjis8PDCKZiIKJlqHkJfiE=r11q
-----END PGP PUBLIC KEY BLOCK-----
-------------- next part --------------
chip "asb100-*"
    set vrm 9.0

    label in0 "VCore 1"
    set in0_min vid * 0.95
    set in0_max vid * 1.05

    label in1 "VCore 2"
    ignore in1
    set in1_min vid * 0.95
    set in1_max vid * 1.05

    label in2 "+3.3V"
    set in2_min 3.3 * 0.95
    set in2_max 3.3 * 1.05

    label in3 "+5V"
    compute in3 1.68 * @ ,  @ / 1.68
    set in3_min 5.0 * 0.95
    set in3_max 5.0 * 1.05

    label in4 "+12V"
    compute in4 3.8 * @ , @ / 3.8
    set in4_min 12  * 0.90
    set in4_max 12  * 1.10

    label in5 "-12V"
    compute in5 -@ * 3.97 ,  -@ / 3.97
    set in5_max -12 * 0.90
    set in5_min -12 * 1.10

    label in6 "-5V"
    compute in6 -@ * 1.666 , -@ / 1.666
    set in6_max -5  * 0.95
    set in6_min -5  * 1.05

    label temp1 "mb_temp"
    set temp1_over 45
    set temp1_hyst 40

    label temp2 "cpu_temp"
    set temp2_over 65
    set temp2_hyst 60

    # PWRTMP connector on P4S333, for external sensor
    ignore temp3
    label temp3 "Power Temp"
    set temp3_over 60
    set temp3_hyst 65

    # Used for Athlon diode, ignore for P4S333
    ignore temp4
    label temp4 "CPU Temp (AMD)"
    set temp4_over 60
    set temp4_hyst 50

    label fan1 "cpu_fan"
    set fan1_div 4
    set fan1_min 1300

    label fan2 "big_fan"
    set fan2_div 4
    set fan2_min 1900

    label fan3 "psu_fan"
    set fan3_div 4
    set fan3_min 1450

    compute fan1  @/2.12,  2*@
    compute fan2  @/2,     2*@
    compute fan3  @/2,     2*@
#7 lore raw
In reply to Jean Delvare

I applied the patch to 2.6.2-rc3 and wrote a simple perl script to test the output of sensors:

Executing 50 tests of diode output
(Checking every 3 seconds)
[50] +48?C
[49] +51?C
[48] +54?C
[47] +50?C
[46] +51?C
[45] +51?C
[44] +52?C
[43] +49?C
[42] +51?C
[41] +52?C
[40] +50?C
[39] +54?C
[38] +51?C
[37] +56?C
[36] +56?C
[35] +58?C
[34] +56?C
[33] +61?C
[32] +59?C
[31] +58?C
[30] +52?C
[29] +50?C
[28] +51?C
[27] +51?C
[26] +50?C
[25] +51?C
[24] +52?C
[23] +51?C
[22] +50?C
[21] +52?C
[20] +54?C
[19] +51?C
[18] +51?C
[17] +53?C
[16] +54?C
[15] +51?C
[14] +52?C
[13] +52?C
[12] +51?C
[11] +51?C
[10] +51?C
[9] +52?C
[8] +58?C
[7] +58?C
[6] +51?C
[5] +52?C
[4] +51?C
[3] +52?C
[2] +52?C
[1] +50?C

Executing 20 tests of diode output
(Checking every 1 seconds)
[20] +49?C
[19] +49?C
[18] +48?C
[17] +48?C
[16] +51?C
[15] +51?C
[14] +52?C
[13] +52?C
[12] +51?C
[11] +51?C
[10] +49?C
[9] +49?C
[8] +51?C
[7] +51?C
[6] +49?C
[5] +49?C
[4] +51?C
[3] +51?C
[2] +50?C
[1] +50?C

Hope that's off some use, haven't had any "-1" values,

J. Bolt

Quoted 12 lines · you

[Please CC: the mailing-list on reply.]

Quoting myself:

Quoted 4 lines

We usually ignore read errors in chip drivers because they are rare, but since it happens so frequently with that specific chip, we will have to do it here. I will try to implement the solutions listed above, if you want to help me test them.

Here is a patch, tested to apply and compile on Linux 2.6.2-rc3. Could you please give it a try? It should solve the rare "-1" readings problem, as well as possible misdetection issues.

Quoted 7 lines

If the driver is really unable to read a register value, it will silently return the previously known value (or 0 if it doesn't have one yet). Maybe we could log the incident, although I'm fairly certain it will never happen, providing the number of max retries is high enough (I set it to 5 for now).

Thanks.

=== diode-test.pl ==
#!/usr/bin/perl -w

$LOOP = 20;
$SLEEP = 1;

sub read_sensor()

{
    $SENSOR = `sensors w83l785ts-i2c-1-2e | grep 'temp:'`;
    $SENSOR =~ /[\^\:]+[\s]+([^\s]+)/;
    return $1;
}

print "Executing " . $LOOP . " tests of diode output\n"; print " (Checking every ".$SLEEP." seconds)\n";

while ($LOOP) {
    print "\[".$LOOP."\] " . read_sensor() . "\n";
    sleep($SLEEP);
    $LOOP--
}

=========

Signature · 23 lines
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1.2.4 (GNU/Linux)

mQGiBD7s3PIRBAC2KWjpIG0YfRLgIHUxBrFQmTiIq0yQlaBa7vgjSkKroEtvSjBS
sk5N9NE0y92rGa7C2pfG0w1/rmEghyTLRRfUKyXAnLr/jE6QEnT4yIN+4mRodwZg
bDlSML0AQ09JUv+QBidGtd1kH01lvRdnbCvsMyMN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CK-----
#8 lore raw
In reply to Jean Delvare
Quoted 18 lines · you

Quoting "J. Bolt" <[email protected]>:

Quoted 16 lines

I applied the patch to 2.6.2-rc3 and wrote a simple perl script to test the output of sensors:

Executing 50 tests of diode output
(Checking every 3 seconds)
[50] +48?C
[49] +51?C
[48] +54?C
[47] +50?C
[46] +51?C
[45] +51?C
[44] +52?C
[43] +49?C
[42] +51?C
[41] +52?C
(...)

Quoted 9 lines

Looks good. The rather fast variations are expected since the thermal diode is inside the CPU itself.

Quoted 2 lines

Executing 20 tests of diode output
(Checking every 1 seconds)

Note that the driver caches the data for 2 seconds anyway, so you can't see changes faster than that. This explains why you see pairs of

That was the idea :)

Quoted 20 lines

identical values in the following list:

Quoted 12 lines

[20] +49?C
[19] +49?C
[18] +48?C
[17] +48?C
[16] +51?C
[15] +51?C
[14] +52?C
[13] +52?C
[12] +51?C
[11] +51?C
(...)

Quoted 1 line

Hope that's off some use, haven't had any "-1" values,

Thanks for testing. Since the new driver hides the errors as it "corrects" them, there's no easy way to know how useful the improved (or should I call it insisting) read method is. I really think we should make it more verbose.

Quoted 7 lines

Could you please apply the attached patch (on top of the previous one) and recompile the w83l785ts driver with DEBUG enabled? No need to recompile the whole kernel, just updating the w83l785ts module should do it. Running your test script should then trigger the debug log (and possibly the error log but I doubt it). I wonder how frequently the retry will be necessary, and wether you'll sometimes need more than one retry.

Ok, I've patched the module again and adapted the script a bit - adding timestamps & debug log retrieval.

I have uploaded the first output with 2 seconds between execution to:
http://james.evilpenguin.com/sensors/

I thought 1000 executions would be sufficient unless you think I need to run it longer or for a specified period of time?

Quoted 5 lines

I would appreciate it much if you could let your script run long enough to have some solid statistics about the phenomenon.

Thanks.

I think the log files it produces are pretty self explanatory, it'll highlight an error w/ (ERROR) etc.

Will upload the rest as it finishes executing them,

James Bolt

Signature · 23 lines
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1.2.4 (GNU/Linux)

mQGiBD7s3PIRBAC2KWjpIG0YfRLgIHUx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VQPCHeo
veqIRgQYEQIABgUCPuzc8gAKCRDNGQw7n7hm7ZQjAJ0faoGh6Eq4WSxYk1xMf4rC
6/IehwCdH/Tq0Yjis8PDCKZiIKJlqHkJfiE=r11q
-----END PGP PUBLIC KEY BLOCK-----
#9 lore raw
In reply to Jean Delvare
Quoted 5 lines · Jean Delvare
Quoted 2 lines

Ok, I've patched the module again and adapted the script a bit - adding timestamps & debug log retrieval.

You're quite good at Perl, aren't you? :)

Wish I could be good at C++ :P

Quoted 11 lines
Quoted 5 lines

I have uploaded the first output with 2 seconds between execution to:
http://james.evilpenguin.com/sensors/

I thought 1000 executions would be sufficient unless you think I need to run it longer or for a specified period of time?

No, it's perfect.

Strange that the number of errors varies so much between the three runs, with no obvious logic.

A result that goes hand in hand with the unpredictable nature of the motherboard itself :/

Quoted 6 lines

Here are the stats:
Immediate success: 85.5%
Success after 1 retry: 10.4%
Success after 2 retries: 0.9%
Success after 3 retries: 0.03%

Quoted 9 lines

The high ratio of non-immediate successes clearly shows that the new read method is welcome. The fact 3 retries were necessary only once out of 3000 reads shows that setting max_retries to 5 isn't a bad choice. I think we can leave it this way.

I'm pretty happy with the results and think of sending the patch to Greg KH for inclusion into Linux 2.6, if it's OK for you too. I also plan to backport the changes to our CVS (Linux 2.4 compatible) driver.

Excellent.

Quoted 1 line

Thanks a lot for the great testing of my code. You'll got credits.

No problem, relieved some boredom. I'm sure many other A7N8X users out there will be pleased to see it supported, regardless of how accurate/useful it actually is.

Thanks for the patches.

James Bolt

Signature · 23 lines
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1.2.4 (GNU/Linux)

mQGiBD7s3PIRBAC2KWjpIG0YfRLgIHUxBrFQmTiIq0yQlaBa7vgjSkKroEtvSjBS
sk5N9NE0y92rGa7C2pfG0w1/rmEghyTLRRfUKyXAnLr/jE6QEnT4yIN+4mRodwZg
bDlSML0AQ09JUv+QBidGtd1kH01lvRdnbCvsMyMNmsp6ryS6pneRKJQ7AwCgyR5I
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Quoted 2 lines

Ok, I've patched the module again and adapted the script a bit - adding timestamps & debug log retrieval.

You're quite good at Perl, aren't you? :)

Quoted 5 lines

I have uploaded the first output with 2 seconds between execution to:
http://james.evilpenguin.com/sensors/

I thought 1000 executions would be sufficient unless you think I need to run it longer or for a specified period of time?

No, it's perfect.

Strange that the number of errors varies so much between the three runs, with no obvious logic.

Here are the stats:
Immediate success: 85.5%
Success after 1 retry: 10.4%
Success after 2 retries: 0.9%
Success after 3 retries: 0.03%

The high ratio of non-immediate successes clearly shows that the new read method is welcome. The fact 3 retries were necessary only once out of 3000 reads shows that setting max_retries to 5 isn't a bad choice. I think we can leave it this way.

I'm pretty happy with the results and think of sending the patch to Greg KH for inclusion into Linux 2.6, if it's OK for you too. I also plan to backport the changes to our CVS (Linux 2.4 compatible) driver.

Thanks a lot for the great testing of my code. You'll got credits.

Signature · 2 lines
Jean Delvare
http://www.ensicaen.ismra.fr/~delvare/
#11 lore raw
In reply to Jean Delvare

Back in late 2002/Jan. '03 we had a lot of discussion about read errors. Certainly the situation then and now, where most drivers just return a -1, isn't great.
One sentiment was that drivers definitely shouldn't silently return the old value, that definitely wasn't "server-class".
People felt strongly about this.

So what I did back then was update the adm1021 driver as a demonstration. This was just after it got ported to 2.6, so my changes are only in our package, not 2.6.
This driver now sets the appropriate alarms bit on a read failure, and returns the old value. Take a look.

I think at the time I also proposed a new /proc entry, similar to alarms and with the same bitmask, called 'fail'. This would provide an indication separate from the alarm indication.
I'm sure there are other ways... perhaps sysfs opens some new possibilities. Any way to make the sysfs read fail, for example?

You may wish to check the mail archives for more info.

mds

Quoted 36 lines · Jean Delvare
Quoted 2 lines

Ok, I've patched the module again and adapted the script a bit - adding timestamps & debug log retrieval.

You're quite good at Perl, aren't you? :)

Quoted 5 lines

I have uploaded the first output with 2 seconds between execution to:
http://james.evilpenguin.com/sensors/

I thought 1000 executions would be sufficient unless you think I need to run it longer or for a specified period of time?

No, it's perfect.

Strange that the number of errors varies so much between the three runs, with no obvious logic.

Here are the stats:
Immediate success: 85.5%
Success after 1 retry: 10.4%
Success after 2 retries: 0.9%
Success after 3 retries: 0.03%

The high ratio of non-immediate successes clearly shows that the new read method is welcome. The fact 3 retries were necessary only once out of 3000 reads shows that setting max_retries to 5 isn't a bad choice. I think we can leave it this way.

I'm pretty happy with the results and think of sending the patch to Greg KH for inclusion into Linux 2.6, if it's OK for you too. I also plan to backport the changes to our CVS (Linux 2.4 compatible) driver.

Thanks a lot for the great testing of my code. You'll got credits.