summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaptor Engineering Development Team <support@raptorengineering.com>2019-05-10 05:28:43 +0000
committerRaptor Engineering Development Team <support@raptorengineering.com>2019-05-10 21:18:33 +0000
commit6a2f7452a635071a267d8a888a21038263efbca5 (patch)
tree282853dbd53bc57ec2fbf3e58247eccee4e96fe7
parent89326b9c4328f56403fa13e251a6a0eea392a646 (diff)
downloadblackbird-obmc-linux-6a2f7452a635071a267d8a888a21038263efbca5.tar.gz
blackbird-obmc-linux-6a2f7452a635071a267d8a888a21038263efbca5.zip
hwmon/aspeed-pwm-tacho: Return 0 RPM if fan disconnected / failed
Having a tachometer read return an -ETIMEDOUT error condition instead of 0 RPM due to a disconnected or failed fan is highly unexpected, and depending on higher level software can cause application failures. Return 0 RPM if tachometer cannot be read. This should trigger the same error paths in any sane fan control implementation without requiring special handling for the AST2x00 devices. Signed-off-by: Timothy Pearson <tpearson@raptorengineering.com>
-rw-r--r--drivers/hwmon/aspeed-pwm-tacho.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/hwmon/aspeed-pwm-tacho.c b/drivers/hwmon/aspeed-pwm-tacho.c
index c4dd6301e7c8..a9bf01a46737 100644
--- a/drivers/hwmon/aspeed-pwm-tacho.c
+++ b/drivers/hwmon/aspeed-pwm-tacho.c
@@ -548,7 +548,11 @@ static int aspeed_get_fan_tach_ch_rpm(struct aspeed_pwm_tacho_data *priv,
ASPEED_RPM_STATUS_SLEEP_USEC,
usec);
- /* return -ETIMEDOUT if we didn't get an answer. */
+ /* if we got -ETIMEDOUT (no answer) return 0 RPM... */
+ if (ret == -ETIMEDOUT)
+ return 0;
+
+ /* ...otherwise return received error. */
if (ret)
return ret;
OpenPOWER on IntegriCloud