From: Shahar Shitrit Date: Thu, 13 Feb 2025 09:46:40 +0000 (+0200) Subject: net/mlx5: Modify LSB bitmask in temperature event to include only the first bit X-Git-Tag: v6.15-rc1~160^2~309^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=633f16d7e07c129a36b882c05379e01ce5bdb542;p=thirdparty%2Flinux.git net/mlx5: Modify LSB bitmask in temperature event to include only the first bit 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 Signed-off-by: Tariq Toukan Reviewed-by: Mateusz Polchlopek Link: https://patch.msgid.link/20250213094641.226501-4-tariqt@nvidia.com Signed-off-by: Jakub Kicinski --- diff --git a/drivers/net/ethernet/mellanox/mlx5/core/events.c b/drivers/net/ethernet/mellanox/mlx5/core/events.c index a661aa522a9ad..e85a9042e3c24 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/events.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/events.c @@ -163,6 +163,10 @@ static int temp_warn(struct notifier_block *nb, unsigned long type, void *data) u64 value_msb; value_lsb = be64_to_cpu(eqe->data.temp_warning.sensor_warning_lsb); + /* bit 1-63 are not supported for NICs, + * hence read only bit 0 (asic) from lsb. + */ + value_lsb &= 0x1; value_msb = be64_to_cpu(eqe->data.temp_warning.sensor_warning_msb); if (net_ratelimit())