]> git.baikalelectronics.ru Git - kernel.git/commit
mlxsw: thermal: Read module temperature thresholds using MTMP register
authorMykola Kostenok <c_mykolak@nvidia.com>
Tue, 8 Jun 2021 12:44:14 +0000 (15:44 +0300)
committerDavid S. Miller <davem@davemloft.net>
Tue, 8 Jun 2021 21:39:07 +0000 (14:39 -0700)
commit54a60f2d79d3cce14f5a03d2a63e95eb0480018e
tree3890a3770d12c5cb30714352e6dad96f40a060ec
parent18c0af27d56f84acd37b3f390f9dd14dbc7134cd
mlxsw: thermal: Read module temperature thresholds using MTMP register

mlxsw_thermal_module_trips_update() is used to update the trip points of
the module's thermal zone. Currently, this is done by querying the
thresholds from the module's EEPROM via MCIA register. This data does
not pass validation and in some cases can be unreliable. For example,
due to some problem with transceiver module.

Previous patch made it possible to read module's temperature and
thresholds via MTMP register. Therefore, extend
mlxsw_thermal_module_trips_update() to use the thresholds queried from
MTMP, if valid.

This is both more reliable and more efficient than current method, as
temperature and thresholds are queried in one transaction instead of
three. This is significant when working over a slow bus such as I2C.

Signed-off-by: Mykola Kostenok <c_mykolak@nvidia.com>
Acked-by: Vadim Pasternak <vadimp@nvidia.com>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/core_thermal.c