mlxsw: core: Do not worry about changing 'enable_string_tlv' while sending EMADs
authorAmit Cohen <amcohen@nvidia.com>
Thu, 19 Jan 2023 10:32:29 +0000 (11:32 +0100)
committerJakub Kicinski <kuba@kernel.org>
Sat, 21 Jan 2023 02:50:15 +0000 (18:50 -0800)
commit563bd3c490dc6cfc4c604446d81e92a67a986e0c
treeec7af4c562a7a9b80e163fe574dac5317ad6e2c3
parentd84e2359e621db111de5904976bc8a721d0fb03b
mlxsw: core: Do not worry about changing 'enable_string_tlv' while sending EMADs

Till now, the field 'mlxsw_core->emad.enable_string_tlv' is set as part
of mlxsw_sp_init(), this means that it can be changed during
emad_reg_access(). To avoid such change, this field is read once in
emad_reg_access() and the value is used all the way.

The previous patch sets this value according to MGIR output, as part of
mlxsw_emad_init(), so now it cannot be changed while sending EMADs.

Do not save 'enable_string_tlv' and do not pass it to functions, just pass
'struct mlxsw_core' and use the value directly from it.

Signed-off-by: Amit Cohen <amcohen@nvidia.com>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: Petr Machata <petrm@nvidia.com>
Reviewed-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/mellanox/mlxsw/core.c