Skip to contentSkip to conversation

drm/powerplay: Ratelimit PP_ASSERT warnings

PATCH In review Kent Russell 2 participants 2 messages Feb 12, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

Change-Id Ib817fd9227e9ffec8f1ed18c5441cbb135bc413b
---
 drivers/gpu/drm/amd/powerplay/inc/pp_debug.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/powerplay/inc/pp_debug.h +2 -2
index 822cd8b5bf90..cea65093b6ad 100644
@@ -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)
 
Signature · 6 lines
2.17.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines · 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
Quoted 29 lines
---
 drivers/gpu/drm/amd/powerplay/inc/pp_debug.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/powerplay/inc/pp_debug.h +2 -3
index 822cd8b5bf90..cea65093b6ad 100644
@@ -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

Quoted 4 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx