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

Currently, module temperature thresholds are obtained from Management
Cable Info Access (MCIA) register by specifying the thresholds offsets
within module EEPROM layout. This data does not pass validation and in
some cases can be unreliable. For example, due to some problem with the
module.

Add support for a new feature provided by Management Temperature (MTMP)
register for sanitization of temperature thresholds values.

Extend mlxsw_env_module_temp_thresholds_get() to get temperature
thresholds through MTMP field 'max_operational_temperature' - if it is
not zero, feature is supported. Otherwise fallback to old method and get
the thresholds through MCIA.

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_env.c