From: Kent Russell Date: Wed, 12 Feb 2020 14:33:13 +0000 (-0500) Subject: drm/powerplay: Ratelimit PP_ASSERT warnings X-Git-Tag: v5.10.7~2823^2~26^2~99 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=00151afc6ff94bf38bf66dbdf377b26a94aaa8e6;p=platform%2Fkernel%2Flinux-rpi.git drm/powerplay: Ratelimit PP_ASSERT warnings In certain situations the message could be reported dozens-to-hundreds of times, based on how often the function is called. E.g. If MCLK DPM, any calls to get/set MCLK will result in a failure message, potentially flooding dmesg. Ratelimit the warnings to avoid this flood. Signed-off-by: Kent Russell Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher --- diff --git a/drivers/gpu/drm/amd/powerplay/inc/pp_debug.h b/drivers/gpu/drm/amd/powerplay/inc/pp_debug.h index 822cd8b..cea6509 100644 --- a/drivers/gpu/drm/amd/powerplay/inc/pp_debug.h +++ b/drivers/gpu/drm/amd/powerplay/inc/pp_debug.h @@ -37,7 +37,7 @@ #define PP_ASSERT_WITH_CODE(cond, msg, code) \ do { \ if (!(cond)) { \ - pr_warn("%s\n", msg); \ + pr_warn_ratelimited("%s\n", msg); \ code; \ } \ } while (0) @@ -45,7 +45,7 @@ #define PP_ASSERT(cond, msg) \ do { \ if (!(cond)) { \ - pr_warn("%s\n", msg); \ + pr_warn_ratelimited("%s\n", msg); \ } \ } while (0)