All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/powerplay: Ratelimit PP_ASSERT warnings
@ 2020-02-12 14:39 Kent Russell
  2020-02-12 15:59 ` Alex Deucher
  0 siblings, 1 reply; 2+ messages in thread
From: Kent Russell @ 2020-02-12 14:39 UTC (permalink / raw)
  To: amd-gfx; +Cc: Kent Russell

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.

Change-Id: Ib817fd9227e9ffec8f1ed18c5441cbb135bc413b
Signed-off-by: Kent Russell <kent.russell@amd.com>
---
 drivers/gpu/drm/amd/powerplay/inc/pp_debug.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/powerplay/inc/pp_debug.h b/drivers/gpu/drm/amd/powerplay/inc/pp_debug.h
index 822cd8b5bf90..cea65093b6ad 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)
 
-- 
2.17.1

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] drm/powerplay: Ratelimit PP_ASSERT warnings
  2020-02-12 14:39 [PATCH] drm/powerplay: Ratelimit PP_ASSERT warnings Kent Russell
@ 2020-02-12 15:59 ` Alex Deucher
  0 siblings, 0 replies; 2+ messages in thread
From: Alex Deucher @ 2020-02-12 15:59 UTC (permalink / raw)
  To: Kent Russell; +Cc: amd-gfx list

On Wed, Feb 12, 2020 at 9:39 AM Kent Russell <kent.russell@amd.com> wrote:
>
> 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.
>
> Change-Id: Ib817fd9227e9ffec8f1ed18c5441cbb135bc413b
> Signed-off-by: Kent Russell <kent.russell@amd.com>

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>

> ---
>  drivers/gpu/drm/amd/powerplay/inc/pp_debug.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/powerplay/inc/pp_debug.h b/drivers/gpu/drm/amd/powerplay/inc/pp_debug.h
> index 822cd8b5bf90..cea65093b6ad 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)
>
> --
> 2.17.1
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-02-12 15:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-12 14:39 [PATCH] drm/powerplay: Ratelimit PP_ASSERT warnings Kent Russell
2020-02-12 15:59 ` Alex Deucher

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.