diff mbox series

[v2,6/6] crypto: ccree: rate limit debug print

Message ID 1530428560-4440-7-git-send-email-gilad@benyossef.com
State Accepted
Commit 5c324a2ffa06f8b6fda59a77c6807acb9f45cfee
Headers show
Series crypto: fixes and cleanups | expand

Commit Message

Gilad Ben-Yossef July 1, 2018, 7:02 a.m. UTC
A debug print about register status post interrupt can happen
quite often. Rate limit it to avoid cluttering the log.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>

Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
 drivers/crypto/ccree/cc_driver.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

-- 
2.7.4

Comments

Geert Uytterhoeven July 2, 2018, 12:58 p.m. UTC | #1
Hi Gilad,

On Sun, Jul 1, 2018 at 9:05 AM Gilad Ben-Yossef <gilad@benyossef.com> wrote:
> A debug print about register status post interrupt can happen

> quite often. Rate limit it to avoid cluttering the log.

>

> Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>

> Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>


Thanks for your patch!

> --- a/drivers/crypto/ccree/cc_driver.c

> +++ b/drivers/crypto/ccree/cc_driver.c

> @@ -131,8 +131,8 @@ static irqreturn_t cc_isr(int irq, void *dev_id)

>         }

>

>         if (irr) {

> -               dev_dbg(dev, "IRR includes unknown cause bits (0x%08X)\n",

> -                       irr);

> +               dev_dbg_ratelimited(dev, "IRR includes unknown cause bits (0x%08X)\n",

> +                                   irr);

>                 /* Just warning */

>         }


    cc_isr: 932 callbacks suppressed

Tested-by: Geert Uytterhoeven <geert+renesas@glider.be>


Note that it still printed 1410 lines like:

    ccree e6601000.crypto: Got IRR=0x008000D8 (actual value may differ)

but perhaps you do intend to see these during debugging?

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
diff mbox series

Patch

diff --git a/drivers/crypto/ccree/cc_driver.c b/drivers/crypto/ccree/cc_driver.c
index bd974fe..1ff229c 100644
--- a/drivers/crypto/ccree/cc_driver.c
+++ b/drivers/crypto/ccree/cc_driver.c
@@ -131,8 +131,8 @@  static irqreturn_t cc_isr(int irq, void *dev_id)
 	}
 
 	if (irr) {
-		dev_dbg(dev, "IRR includes unknown cause bits (0x%08X)\n",
-			irr);
+		dev_dbg_ratelimited(dev, "IRR includes unknown cause bits (0x%08X)\n",
+				    irr);
 		/* Just warning */
 	}