Commit a1ffd3c4 authored by Vadim Pasternak's avatar Vadim Pasternak Committed by Guenter Roeck
Browse files

hwmon: (mlxreg-fan) Return zero speed for broken fan

Currently for broken fan driver returns value calculated based on error
code (0xFF) in related fan speed register.
Thus, for such fan user gets fan{n}_fault to 1 and fan{n}_input with
misleading value.

Add check for fan fault prior return speed value and return zero if
fault is detected.

Fixes: 65afb4c8

 ("hwmon: (mlxreg-fan) Add support for Mellanox FAN driver")
Signed-off-by: default avatarVadim Pasternak <vadimp@nvidia.com>
Link: https://lore.kernel.org/r/20230212145730.24247-1-vadimp@nvidia.com


Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
parent 102be2c2
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment