[SRU][F:bluefield][PATCH v1 1/1] UBUNTU: SAUCE: mlx-trio: Use rate-limited prints in interrupt handler

Shravan Kumar Ramani shravankr at nvidia.com
Wed Apr 28 11:15:19 UTC 2021


BugLink: https://bugs.launchpad.net/bugs/1926424

In certain cases such as PCIe link disabled, mlx-trio prints a lot
of messages which blocks UART console or ssh session. This commit
calls dev_err_ratelimited() instead to limit the message amount.
So they could still be printed without affecting other services.

Signed-off-by: Shravan Kumar Ramani <shravankr at nvidia.com>
---
 drivers/platform/mellanox/mlx-trio.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/platform/mellanox/mlx-trio.c b/drivers/platform/mellanox/mlx-trio.c
index b389f2c..1fd1b7a 100644
--- a/drivers/platform/mellanox/mlx-trio.c
+++ b/drivers/platform/mellanox/mlx-trio.c
@@ -302,7 +302,7 @@ static irqreturn_t trio_irq_handler(int irq, void *arg)
 	struct event_context *ctx = (struct event_context *)arg;
 	struct trio_context *trio = ctx->trio;
 
-	dev_err(&trio->pdev->dev,
+	dev_err_ratelimited(&trio->pdev->dev,
 		"mlx_trio: TRIO %d received IRQ %d event %d (%s)\n",
 		trio->trio_index, irq, ctx->event_num,
 		trio_events[ctx->event_num].name);
@@ -312,7 +312,7 @@ static irqreturn_t trio_irq_handler(int irq, void *arg)
 		trio_readq(trio, trio->mmio_base +
 				trio_events[ctx->event_num].additional_info,
 				&info);
-		dev_err(&trio->pdev->dev,
+		dev_err_ratelimited(&trio->pdev->dev,
 			"mlx_trio: Addition IRQ info: %llx\n", info);
 	}
 
-- 
2.1.2




More information about the kernel-team mailing list