IB/hfi1: Ratelimit prints from sdma_interrupt
authorGrzegorz Morys <grzegorz.morys@intel.com>
Tue, 22 Aug 2017 01:26:38 +0000 (18:26 -0700)
committerDoug Ledford <dledford@redhat.com>
Mon, 28 Aug 2017 23:12:18 +0000 (19:12 -0400)
Ratelimit error prints from sdma_interrupt function
that could swarm dmesg otherwise.

Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Grzegorz Morys <grzegorz.morys@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/hw/hfi1/chip.c
drivers/infiniband/hw/hfi1/hfi.h

index eb27c7fbfebd7cfcda1e12163862d6ed58fcb843..b2ed4b9cda6eef62f81b5ac22b71b4cc3a5a2d10 100644 (file)
@@ -8290,8 +8290,8 @@ static irqreturn_t sdma_interrupt(int irq, void *data)
                /* handle the interrupt(s) */
                sdma_engine_interrupt(sde, status);
        } else {
-               dd_dev_err(dd, "SDMA engine %u interrupt, but no status bits set\n",
-                          sde->this_idx);
+               dd_dev_err_ratelimited(dd, "SDMA engine %u interrupt, but no status bits set\n",
+                                      sde->this_idx);
        }
        return IRQ_HANDLED;
 }
index eadb735d958c9d90b3fec4b69ecf5351ae74bc41..3ac9c307a285f1f2ed6a2ab1b8fec680fcd412f0 100644 (file)
@@ -2119,9 +2119,15 @@ static inline u64 hfi1_pkt_base_sdma_integrity(struct hfi1_devdata *dd)
 #define dd_dev_emerg(dd, fmt, ...) \
        dev_emerg(&(dd)->pcidev->dev, "%s: " fmt, \
                  get_unit_name((dd)->unit), ##__VA_ARGS__)
+
 #define dd_dev_err(dd, fmt, ...) \
        dev_err(&(dd)->pcidev->dev, "%s: " fmt, \
                        get_unit_name((dd)->unit), ##__VA_ARGS__)
+
+#define dd_dev_err_ratelimited(dd, fmt, ...) \
+       dev_err_ratelimited(&(dd)->pcidev->dev, "%s: " fmt, \
+                       get_unit_name((dd)->unit), ##__VA_ARGS__)
+
 #define dd_dev_warn(dd, fmt, ...) \
        dev_warn(&(dd)->pcidev->dev, "%s: " fmt, \
                        get_unit_name((dd)->unit), ##__VA_ARGS__)