Skip to content

Commit a0379e4

Browse files
Shahar Shitritopsiff
authored andcommitted
net/mlx5: Modify LSB bitmask in temperature event to include only the first bit
[ Upstream commit 633f16d ] In the sensor_count field of the MTEWE register, bits 1-62 are supported only for unmanaged switches, not for NICs, and bit 63 is reserved for internal use. To prevent confusing output that may include set bits that are not relevant to NIC sensors, we update the bitmask to retain only the first bit, which corresponds to the sensor ASIC. Signed-off-by: Shahar Shitrit <shshitrit@nvidia.com> Signed-off-by: Tariq Toukan <tariqt@nvidia.com> Reviewed-by: Mateusz Polchlopek <mateusz.polchlopek@intel.com> Link: https://patch.msgid.link/20250213094641.226501-4-tariqt@nvidia.com Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org> (cherry picked from commit 69f453ccb9e47ac42e34f8bdaf89d5eebe65eb06)
1 parent 60d20cb commit a0379e4

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

  • drivers/net/ethernet/mellanox/mlx5/core

drivers/net/ethernet/mellanox/mlx5/core/events.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,10 @@ static int temp_warn(struct notifier_block *nb, unsigned long type, void *data)
163163
u64 value_msb;
164164

165165
value_lsb = be64_to_cpu(eqe->data.temp_warning.sensor_warning_lsb);
166+
/* bit 1-63 are not supported for NICs,
167+
* hence read only bit 0 (asic) from lsb.
168+
*/
169+
value_lsb &= 0x1;
166170
value_msb = be64_to_cpu(eqe->data.temp_warning.sensor_warning_msb);
167171

168172
mlx5_core_warn(events->dev,

0 commit comments

Comments
 (0)