mlxsw: core_hwmon: Extend hwmon interface with critical and emergency alarms
authorAmit Cohen <amitc@mellanox.com>
Thu, 3 Sep 2020 13:41:46 +0000 (16:41 +0300)
committerDavid S. Miller <davem@davemloft.net>
Thu, 3 Sep 2020 19:12:05 +0000 (12:12 -0700)
commit91df5d3a72e33446556b49c9b272e89baeec6cd8
tree7f7acb33c231bf7d73c8def0d4d025727ea3a595
parent02bed4e8b705284b593948676ebe1c6629dc5895
mlxsw: core_hwmon: Extend hwmon interface with critical and emergency alarms

Add new attributes to hwmon object for exposing critical and emergency
alarms.

In case that current temperature is higher than emergency threshold,
EMERGENCY alarm will be reported in sensors utility:

$ sensors
...
front panel 025:  +55.0°C  (crit = +35.0°C, emerg = +40.0°C) ALARM(EMERGENCY)

In case that current temperature is higher than critical threshold,
CRIT alarm will be reported in sensors utility:

$ sensors
...
front panel 025:  +54.0°C  (crit = +35.0°C, emerg = +80.0°C) ALARM(CRIT)

Signed-off-by: Amit Cohen <amitc@mellanox.com>
Reviewed-by: Petr Machata <petrm@mellanox.com>
Acked-by: Vadim Pasternak <vadimp@mellanox.com>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/core_hwmon.c