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 B7ACB1EA91; Tue, 27 May 2025 17:02:47 +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=1748365367; cv=none; b=aN/Hg8LHLa6k80o9tLPVatMlxEjC8umbTgumN06+uuLx85nL4pMy9mgc94QszGlZtBAQOhG95yiktB00/1rrEuSknJ8sDd+kXTx8+PZ8nzEYa8Bq8fan1Cll/hIXSGX6g996EC7eNUL2L0YeZOsJ9hKeg6RBzCmUzmMfKvr2PVc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1748365367; c=relaxed/simple; bh=hsPq5QdvZaEBgV3JNmEAQ7LDr+V5MLZGtTDuGX/aYmo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=MZQ4YsedlPer9A4E1ZdSfLwhY/r9+V2QM+iAuSm7eoaAZ9fcvyM2apnPZ8kipf6+x6UuaiZI8L7CoR60EIwZujQoZr7MIHNGUw3eChthj7d7vgn9uNhtFSKu0FxS93Z+FOv/vWdtjlor9d4kYt97jb9MUuXahBCrAn2xGc4lCFA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=jliC/qmk; 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="jliC/qmk" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2C031C4CEE9; Tue, 27 May 2025 17:02:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1748365367; bh=hsPq5QdvZaEBgV3JNmEAQ7LDr+V5MLZGtTDuGX/aYmo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jliC/qmkWI3R8vz7S/H/rEv/yYAe8xPnqINAjWFk19v/pgwC1a2tqVEUkKOiQdyAR W2CzMwgtL8wSpmfA0BqRJ+9TYy2ToxwocNqCvrQn213mDpwFEoCXR5Bn5pphr4+37y qR5+cIWC73gGpsB+OlzRNsGpHFZOB5IBj9lIDdGU= 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 6.12 354/626] net/mlx5: Apply rate-limiting to high temperature warning Date: Tue, 27 May 2025 18:24:07 +0200 Message-ID: <20250527162459.401433333@linuxfoundation.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250527162445.028718347@linuxfoundation.org> References: <20250527162445.028718347@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 6.12-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 cd8d107f7d9e3..fc6e56305cbbc 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/events.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/events.c @@ -169,9 +169,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