rpm of 0 with smsc47m1 does not cause alarm
I have recently noticed that one of the fans on a box I am monitoring is no longer sending a tachometer signal, so sensors(1) indicates the
RPM=0. This is as you would expect. However, I would expect
sensors(1) to report an ALARM for this fan. That is not what I am seeing:
smsc47m1-isa-0680
Adapter: ISA adapter
superio,Fan1:
0 RPM (min = 1396 RPM, div = 8)
superio,Fan2:
0 RPM (min = 1396 RPM, div = 8)# cat /proc/sys/dev/sensors/smsc47m1-isa-0680/alarms 0
Hmmm... This indicates to me that maybe the part doesn't think there's a problem??
I really need to get alarms in the cases where the fans are not working.
In researching this, the fan tachometer has not been working for a long time (wiring problem), so if it makes any difference, the superio chip has never seen any tachometer signals since power on.
Any suggestions??
David
Hi David,
Quoted 11 lines
# isadump -f 0x0680 0x800 1 2 3 4 5 6 7 8 9 a b c d e f
00: 01 00 01 00 18 ff e7 18 00 00 18 00 00 00 00 00 10: 02 06 67 18 c0 00 00 00 00 00 00 00 00 00 03 03 20: 81 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 30: 00 00 00 05 05 04 04 01 00 04 84 84 00 01 01 05 40: 05 05 04 05 04 05 04 01 01 00 00 00 84 13 04 57 50: 00 00 00 00 00 00 14 14 f0 ff ff 68 68 00 00 00 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Bits 6 and 7 of register 0x04 are actually cleared, so this is no driver bug. The chipset doesn't set the flags. After reading the datasheet again, I don't thing there is a way to disable them, so they have to be enabled (but not set at the moment). Could be that the chipset does only raise an alarm on slow fan, not on stopped/absent fan. Doesn't make much sense of course, but that may still be true.
I'd suggest that you give a try with a working fan and make sure you get a valid speed reported. Then change the low limit above the fan speed, and see if the alarm triggers. If it does, but disappears if you then unplug the fan, then I guess it validates my theory.
We may consider faking the alarm bits it this specific case, since it's odd that the chipset doesn't do it, and is contrary to what other chips such as the LM87 do, if I'm not mistaken.
Signature · 2 lines
Jean Delvare http://khali.linux-fr.org/
Quoted 3 lines · Jean Delvare
1* Tell us which version of
lm_sensorsyou are using, with which Linux kernel.
I am running the CVS version of lm_sensors updated on October 15.
I am running a modified Red Hat 9 kernel, based on the last errata kernel from Red Hat, 2.4.20-31.9bigmem. The only modifications that are related to sensors are the removal of the old version from the kernel. The CVS version of lm_sensors and i2c are rebuilt independently from the kernel.
Quoted 2 lines
2* Provide a dump of the chip (isadump -f
0x06800x80).
# isadump -f 0x0680 0x80
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: 01 00 01 00 18 ff e7 18 00 00 18 00 00 00 00 00 10: 02 06 67 18 c0 00 00 00 00 00 00 00 00 00 03 03 20: 81 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 30: 00 00 00 05 05 04 04 01 00 04 84 84 00 01 01 05 40: 05 05 04 05 04 05 04 01 01 00 00 00 84 13 04 57 50: 00 00 00 00 00 00 14 14 f0 ff ff 68 68 00 00 00 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Thanks again,
David
Hi David,
Quoted 13 lines
I have recently noticed that one of the fans on a box I am monitoring is no longer sending a tachometer signal, so sensors(1) indicates the
RPM=0. This is as you would expect. However, I would expect
sensors(1) to report an ALARM for this fan. That is not what I am seeing:smsc47m1-isa-0680
Adapter: ISA adapter
superio,Fan1:0 RPM (min = 1396 RPM, div = 8) superio,Fan2: 0 RPM (min = 1396 RPM, div = 8)
Quoted 5 lines
# cat /proc/sys/dev/sensors/smsc47m1-isa-0680/alarms 0Hmmm... This indicates to me that maybe the part doesn't think there's a problem??
I would say so. Alarms are reported as generated by the hardware, the sensors program doesn't compute them.
However, this could also be caused by a software bug, or maybe there is a way to reconfigure the chip (sometimes alarms are individually maskable). I'll take a look at the datasheet again when I am back home in the evening. In the meantime, could you please:
1* Tell us which version of lm_sensors you are using, with which Linux kernel.
2* Provide a dump of the chip (isadump -f 0x0680 0x80).
--
Jean Delvare
I looked at this also and the datasheet seems clear that the alarm bits in register 4 do not require the corresponding bits in the enable register (0x0a) to be set, so I don't get it.
The only thing I can think of is that the documentation is wrong; setting the bits in the enable register as follows
isaset -f 0x68a 0xd8
would show us whether this is true.
Quoted 32 lines · Jean Delvare
Hi David,
Quoted 11 lines
# isadump -f 0x0680 0x800 1 2 3 4 5 6 7 8 9 a b c d e f
00: 01 00 01 00 18 ff e7 18 00 00 18 00 00 00 00 00 10: 02 06 67 18 c0 00 00 00 00 00 00 00 00 00 03 03 20: 81 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 30: 00 00 00 05 05 04 04 01 00 04 84 84 00 01 01 05 40: 05 05 04 05 04 05 04 01 01 00 00 00 84 13 04 57 50: 00 00 00 00 00 00 14 14 f0 ff ff 68 68 00 00 00 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00Bits 6 and 7 of register
0x04are actually cleared, so this is no driver bug. The chipset doesn't set the flags. After reading the datasheet again, I don't thing there is a way to disable them, so they have to be enabled (but not set at the moment). Could be that the chipset does only raise an alarm on slow fan, not on stopped/absent fan. Doesn't make much sense of course, but that may still be true.I'd suggest that you give a try with a working fan and make sure you get a valid speed reported. Then change the low limit above the fan speed, and see if the alarm triggers. If it does, but disappears if you then unplug the fan, then I guess it validates my theory.
We may consider faking the alarm bits it this specific case, since it's odd that the chipset doesn't do it, and is contrary to what other chips such as the LM87 do, if I'm not mistaken.
Quoted 16 lines · Jean Delvare
Hi David,
Quoted 11 lines
# isadump -f 0x0680 0x800 1 2 3 4 5 6 7 8 9 a b c d e f
00: 01 00 01 00 18 ff e7 18 00 00 18 00 00 00 00 00 10: 02 06 67 18 c0 00 00 00 00 00 00 00 00 00 03 03 20: 81 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 30: 00 00 00 05 05 04 04 01 00 04 84 84 00 01 01 05 40: 05 05 04 05 04 05 04 01 01 00 00 00 84 13 04 57 50: 00 00 00 00 00 00 14 14 f0 ff ff 68 68 00 00 00 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Quoted 6 lines
Bits 6 and 7 of register
0x04are actually cleared, so this is no driver bug. The chipset doesn't set the flags. After reading the datasheet again, I don't thing there is a way to disable them, so they have to be enabled (but not set at the moment). Could be that the chipset does only raise an alarm on slow fan, not on stopped/absent fan. Doesn't make much sense of course, but that may still be true.
OK. I finally got a bit of time to look at this again. Here's what I've seen, even if it doesn't make any sense.
I'm running a Red Hat 9 box with version 2.9.0 of i2c and lm_sensors
now. This box also has two lm87s in it. The fan speeds of 6 fans are
controlled by the smsc superio. Each superio pwm output controls 3 fans. One of those fans is monitored by the superio and the remaining two are each monitored by a different lm87.
After upgrading to the latest version of lm_sensors and i2c, I verified
the fan speeds and fan control. It worked as expected.
I then shut off the server and unplugged one bank of fans (don't worry, they are set up in a redundant configuration). When I booted up, the unplugged fans showed alarms on the lm87s but not on the smsc superio.
I then raised the alarm threshold for the smsc monitored fans in the /etc/sensors.conf to a value greater than the fans were currently
running. I then ran sensors -s. Sensors showed errors for BOTH fans
on the superIO the first time it was run, then the error on the
disconnected fan cleared. I then tried running sensors -s by itself.
Each time I ran sensors -s followed by sensors, the disconnected fan
on the superIO had an alarm, but it cleared the second time sensors was run.
Quoted 5 lines
I'd suggest that you give a try with a working fan and make sure you get a valid speed reported. Then change the low limit above the fan speed, and see if the alarm triggers. If it does, but disappears if you then unplug the fan, then I guess it validates my theory.
The fans get a valid speed report. As explained above, I can see the alarms triggered when the fan speeds drop below the alarm threshold.
However... I've found something new when trying the "unplug the fan
test". When I unplugged the fan, sensors indicates that the fan speed
has not changed. Here's the output of sensors:
# sensors
lm87-i2c-1-2d
Adapter: SMBus I801 adapter at 0540
mon0,+V2_5:
+2.49 V (min = +2.37 V, max = +2.62 V)
+vcc_cpu: +1.46 V (min = +1.35 V, max = +1.55 V)
mon0,+V3_3:
+3.30 V (min = +3.16 V, max = +3.44 V)
mon0,+V5_0:
+4.97 V (min = +4.74 V, max = +5.26 V)
mon0,+V12:+12.13 V (min = +11.38 V, max = +12.63 V)
battv_mon: +3.14 V (min = +2.70 V, max = +3.30 V)
mon0,Fan1: 0 RPM (min = 1394 RPM, div = 8) ALARM
mon0,Fan2:1493 RPM (min = 1394 RPM, div = 8)
mon0,AmbT: +28?C (low = +0?C, high = +60?C)lm87-i2c-1-2e
Adapter: SMBus I801 adapter at 0540
mon1,+V2_5:
+2.50 V (min = +2.37 V, max = +2.62 V)
mon1,+V1_8:
+1.79 V (min = +1.72 V, max = +1.88 V)
mon1,+V3_3:
+3.30 V (min = +3.16 V, max = +3.44 V)
mon1,+V5_0:
+4.97 V (min = +4.74 V, max = +5.26 V)
mon1,+V12:+12.13 V (min = +11.38 V, max = +12.63 V)
mon1,+V1_2:
+1.20 V (min = +1.13 V, max = +1.27 V)
mon1,Fan1: 0 RPM (min = 1394 RPM, div = 8) ALARM
mon1,Fan2:1493 RPM (min = 1394 RPM, div = 8)
mon1,AmbT: +28?C (low = +0?C, high = +60?C)smsc47m1-isa-0680
Adapter: ISA adapter
superio,Fan1:
1517 RPM (min = 1396 RPM, div = 8)
superio,Fan2:
1498 RPM (min = 1396 RPM, div = 8)The superio,Fan1 input should read 0.
Here's the dump from the superio chip while it's in this state:
# isadump -f 0x0680 0x80
WARNING! Running this program can cause system crashes, data loss and worse!
I will probe address range 0x680 to 0x6ff.
Continue? [Y/n] y
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: 01 00 01 00 18 ff e7 1f 00 00 d8 00 00 00 00 00
10: 02 02 67 1f c0 00 00 00 00 00 00 00 00 00 03 03
20: 81 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01
30: 00 00 00 05 05 04 04 01 00 04 84 84 00 01 01 05
40: 05 05 04 05 04 05 04 01 01 00 00 00 84 12 04 57
50: 00 00 00 00 00 00 14 14 f0 b9 ba 68 68 00 00 00
60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00Quoted 5 lines
We may consider faking the alarm bits it this specific case, since it's odd that the chipset doesn't do it, and is contrary to what other chips such as the LM87 do, if I'm not mistaken.
As I mentioned, this box has LM87s in it and the smsc superio does not behave the same.
Any thoughts are welcome.
David
Hi David,
Quoted 23 lines
OK. I finally got a bit of time to look at this again. Here's what I've seen, even if it doesn't make any sense.
I'm running a Red Hat 9 box with version 2.9.0 of i2c and
lm_sensors
now. This box also has two lm87s in it. The fan speeds of 6 fans
are controlled by the smsc superio. Each superio pwm output controls 3 fans. One of those fans is monitored by the superio and the remaining two are each monitored by a different lm87.After upgrading to the latest version of
lm_sensorsand i2c, I
verified the fan speeds and fan control. It worked as expected.I then shut off the server and unplugged one bank of fans (don't worry, they are set up in a redundant configuration). When I booted up, the unplugged fans showed alarms on the lm87s but not on the smsc superio.
I then raised the alarm threshold for the smsc monitored fans in the
/etc/sensors.confto a value greater than the fans were currently
running. I then ran sensors -s. Sensors showed errors for BOTH
fans on the superIO the first time it was run, then the error on the
disconnected fan cleared. I then tried running sensors -s by itself.
Quoted 3 lines
Each time I ran sensors -s followed by sensors, the disconnected fan on the superIO had an alarm, but it cleared the second time sensors was run.
Sounds like 1* missing fans don't reassert alarms and 2* writing to the limits register does fore the alarm to reassert if needed.
The smsc47m1 driver clears alarms after it reads them. Typically the other drivers don't do it because other chips do clear them automatically. What you describe suggests that it should probably not be done (or not always). I guess that this code was put there for a reason though. You could try commenting it out (in smsc47m1_update_client):
if(data->alarms)
smsc47m1_write_value(client, SMSC47M1_REG_ALARM1, 0xc0);
But if you do, I suspect that at some point alarms will stay even once the alarm condition has gone.
Also note that we attempt to clear both alarm bits regardless of which is set. Could it be the cause of the trouble you observe (both alarms raised when only one fan is missing)? It would be really weird.
I tend to think that your chip has a hardware issue, either because it is broken or because it wasn't properly wired.
Quoted 14 lines
However... I've found something new when trying the "unplug the fan
test". When I unplugged the fan, sensors indicates that the fan
speed has not changed. Here's the output of sensors:
(...)
smsc47m1-isa-0680
Adapter: ISA adapter
superio,Fan1:1517 RPM (min = 1396 RPM, div = 8) superio,Fan2: 1498 RPM (min = 1396 RPM, div = 8)The superio,Fan1 input should read 0.
Here's the dump from the superio chip while it's in this state:
Quoted 13 lines
# isadump -f 0x0680 0x80
WARNING! Running this program can cause system crashes, data loss and
worse! I will probe address range 0x680 to 0x6ff.
Continue? [Y/n] y
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: 01 00 01 00 18 ff e7 1f 00 00 d8 00 00 00 00 00
10: 02 02 67 1f c0 00 00 00 00 00 00 00 00 00 03 03
20: 81 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01
30: 00 00 00 05 05 04 04 01 00 04 84 84 00 01 01 05
40: 05 05 04 05 04 05 04 01 01 00 00 00 84 12 04 57
50: 00 00 00 00 00 00 14 14 f0 b9 ba 68 68 00 00 00
60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00The dump confirms the non-zero speed report (at 0x59 and 0x5a) and no alarm raised, so this is definitely a hardware issue. Not the first time I hear about this, although I don't remember if it was for the same chip or a different one. At any rate there nothing we can do as far as I can see. Unless you have an idea?
Signature · 2 lines
Jean Delvare http://khali.linux-fr.org/
I've read the PME section of the 47M102 datasheet about 5 times and I still don't know how the stupid bits work.
Obviously if they are edge triggered then the driver shouldn't be clearing them. I can't remember why I put the clear code in there (I assume I did it) but it makes sense that the chip wasn't clearing it.
If the bit is truly edge-triggered then the driver can
also make a comparison and assert ALARM if either the bit is on or the speed comparison fails.
Quoted 89 lines · Jean Delvare
Hi David,
Quoted 23 lines
OK. I finally got a bit of time to look at this again. Here's what I've seen, even if it doesn't make any sense.
I'm running a Red Hat 9 box with version 2.9.0 of i2c and
lm_sensors
now. This box also has two lm87s in it. The fan speeds of 6 fans
are controlled by the smsc superio. Each superio pwm output controls 3 fans. One of those fans is monitored by the superio and the remaining two are each monitored by a different lm87.After upgrading to the latest version of
lm_sensorsand i2c, I
verified the fan speeds and fan control. It worked as expected.I then shut off the server and unplugged one bank of fans (don't worry, they are set up in a redundant configuration). When I booted up, the unplugged fans showed alarms on the lm87s but not on the smsc superio.
I then raised the alarm threshold for the smsc monitored fans in the
/etc/sensors.confto a value greater than the fans were currently
running. I then ran sensors -s. Sensors showed errors for BOTH
fans on the superIO the first time it was run, then the error on the
disconnected fan cleared. I then tried running sensors -s by itself.Quoted 3 lines
Each time I ran sensors -s followed by sensors, the disconnected fan on the superIO had an alarm, but it cleared the second time sensors was run.
Sounds like 1* missing fans don't reassert alarms and 2* writing to the limits register does fore the alarm to reassert if needed.
The smsc47m1 driver clears alarms after it reads them. Typically the other drivers don't do it because other chips do clear them automatically. What you describe suggests that it should probably not be done (or not always). I guess that this code was put there for a reason though. You could try commenting it out (in
smsc47m1_update_client):
if(data->alarms)smsc47m1_write_value(client, SMSC47M1_REG_ALARM1, 0xc0);But if you do, I suspect that at some point alarms will stay even once the alarm condition has gone.
Also note that we attempt to clear both alarm bits regardless of which is set. Could it be the cause of the trouble you observe (both alarms raised when only one fan is missing)? It would be really weird.
I tend to think that your chip has a hardware issue, either because it is broken or because it wasn't properly wired.
Quoted 14 lines
However... I've found something new when trying the "unplug the fan
test". When I unplugged the fan, sensors indicates that the fan
speed has not changed. Here's the output of sensors:
(...)
smsc47m1-isa-0680
Adapter: ISA adapter
superio,Fan1:1517 RPM (min = 1396 RPM, div = 8) superio,Fan2: 1498 RPM (min = 1396 RPM, div = 8)The superio,Fan1 input should read 0.
Here's the dump from the superio chip while it's in this state:
Quoted 13 lines
# isadump -f 0x0680 0x80 WARNING! Running this program can cause system crashes, data loss and worse! I will probe address range 0x680 to 0x6ff. Continue? [Y/n] y 0 1 2 3 4 5 6 7 8 9 a b c d e f 00: 01 00 01 00 18 ff e7 1f 00 00 d8 00 00 00 00 00 10: 02 02 67 1f c0 00 00 00 00 00 00 00 00 00 03 03 20: 81 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 30: 00 00 00 05 05 04 04 01 00 04 84 84 00 01 01 05 40: 05 05 04 05 04 05 04 01 01 00 00 00 84 12 04 57 50: 00 00 00 00 00 00 14 14 f0 b9 ba 68 68 00 00 00 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00The dump confirms the non-zero speed report (at
0x59and0x5a) and no alarm raised, so this is definitely a hardware issue. Not the first time I hear about this, although I don't remember if it was for the same chip or a different one. At any rate there nothing we can do as far as I can see. Unless you have an idea?