From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BF43423183D; Mon, 2 Jun 2025 14:57:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1748876239; cv=none; b=Kto59gtaJedxi8fN5ZmHVUh+h235qoLKSfR9gvMENXyjfvwXlrVqCNCFi98ZNF0EziQ5fG1hsYBFMvGeNeFIxc6HZC6Fk536buBsk7JY6kMEwAJYbqfae7OKaCkN7fOhC9XLCmEKPO4wMHMN+SZwHryaSmQCc3eua3urwlz3Ro0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1748876239; c=relaxed/simple; bh=dQFMnJZX9jpFtvFvEVEmPCSuhtM1I6A/c4eRExKwm1A=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=QfFOdbgyO5KLPWh92c2kIQOm5R1k8DtVozuLhj71Q9R0cQe/yrMDdhNYzvTu5fg4uLZkcCgl9F7/Qr2mg1PzSOspbUCsX93ocMLwWQUJKzU8Nylj7U/5HTqHQtlcFmFo3PlWxIkseaNHsIcnFwcjndDUJERLEin6HX5WDe5E2KI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=kXR84YHY; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="kXR84YHY" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2C785C4CEEB; Mon, 2 Jun 2025 14:57:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1748876239; bh=dQFMnJZX9jpFtvFvEVEmPCSuhtM1I6A/c4eRExKwm1A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kXR84YHY82xTofbNcFA0y3HHrfDNH9F7zeSFk+WTq9PR5HdmTx9lyAVd6Oc8r+JrX 99BDNzbnnoj+8m/BaGe1kKDhxSTjVetGOE6Oe3A6+m3t+Ybo50O+/xTtnyZdB6+mjv K9Va1uYemNg6ZrHKwqzJvD+Ge9J+RkOCJnFgWuNY= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Shahar Shitrit , Tariq Toukan , Mateusz Polchlopek , Jakub Kicinski , Sasha Levin Subject: [PATCH 5.15 114/207] net/mlx5: Apply rate-limiting to high temperature warning Date: Mon, 2 Jun 2025 15:48:06 +0200 Message-ID: <20250602134303.191361687@linuxfoundation.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250602134258.769974467@linuxfoundation.org> References: <20250602134258.769974467@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Shahar Shitrit [ Upstream commit 9dd3d5d258aceb37bdf09c8b91fa448f58ea81f0 ] Wrap the high temperature warning in a temperature event with a call to net_ratelimit() to prevent flooding the kernel log with repeated warning messages when temperature exceeds the threshold multiple times within a short duration. Signed-off-by: Shahar Shitrit Signed-off-by: Tariq Toukan Reviewed-by: Mateusz Polchlopek Link: https://patch.msgid.link/20250213094641.226501-2-tariqt@nvidia.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- drivers/net/ethernet/mellanox/mlx5/core/events.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/events.c b/drivers/net/ethernet/mellanox/mlx5/core/events.c index 080aee3e3f9bb..15d90d68b1ffd 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/events.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/events.c @@ -166,9 +166,10 @@ static int temp_warn(struct notifier_block *nb, unsigned long type, void *data) value_lsb &= 0x1; value_msb = be64_to_cpu(eqe->data.temp_warning.sensor_warning_msb); - mlx5_core_warn(events->dev, - "High temperature on sensors with bit set %llx %llx", - value_msb, value_lsb); + if (net_ratelimit()) + mlx5_core_warn(events->dev, + "High temperature on sensors with bit set %llx %llx", + value_msb, value_lsb); return NOTIFY_OK; } -- 2.39.5