dmaengine: idxd: rate limit printk in misc interrupt thread
authorDave Jiang <dave.jiang@intel.com>
Sun, 24 Sep 2023 00:23:47 +0000 (17:23 -0700)
committerVinod Koul <vkoul@kernel.org>
Thu, 28 Sep 2023 07:55:41 +0000 (13:25 +0530)
Add rate limit to the dev_warn() call in the misc interrupt thread. This
limits dmesg getting spammed if a descriptor submitter is spamming bad
descriptors with invalid completion records and resulting the errors being
continuously reported by the misc interrupt handling thread.

Reported-by: Sanjay Kumar <sanjay.k.kumar@intel.com>
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Reviewed-by: Fenghua Yu <fenghua.yu@intel.com>
Acked-by: Lijun Pan <lijun.pan@intel.com>
Link: https://lore.kernel.org/r/20230924002347.1117757-1-fenghua.yu@intel.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/dma/idxd/irq.c

index b501320a9c7ad06f52ae6202c45968605d084405..2183d7f9cdbdde9fcc9033003dad5144af09eeb7 100644 (file)
@@ -434,8 +434,8 @@ irqreturn_t idxd_misc_thread(int vec, void *data)
                val |= IDXD_INTC_ERR;
 
                for (i = 0; i < 4; i++)
-                       dev_warn(dev, "err[%d]: %#16.16llx\n",
-                                i, idxd->sw_err.bits[i]);
+                       dev_warn_ratelimited(dev, "err[%d]: %#16.16llx\n",
+                                            i, idxd->sw_err.bits[i]);
                err = true;
        }