diff options
author | Raptor Engineering Development Team <support@raptorengineering.com> | 2019-05-10 05:28:43 +0000 |
---|---|---|
committer | Raptor Engineering Development Team <support@raptorengineering.com> | 2019-05-10 21:18:33 +0000 |
commit | 6a2f7452a635071a267d8a888a21038263efbca5 (patch) | |
tree | 282853dbd53bc57ec2fbf3e58247eccee4e96fe7 | |
parent | 89326b9c4328f56403fa13e251a6a0eea392a646 (diff) | |
download | blackbird-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.c | 6 |
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; |