Skip to contentSkip to conversation

drm: add drm_warn_ratelimited() and convert ivpu to use it

PATCH RESEND In review Dawid Osuchowski 2 participants 6 messages Aug 20 – Aug 24

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

cover drm: add drm_warn_ratelimited() and convert ivpu to use it

This patch set adds drm_warn_ratelimited() to the DRM print helpers and updates the ivpu driver to use the warning-level variant instead of err-level logging. The new helper matches the existing rate-limited logging pattern and gives drivers a consistent way to emit warning messages without spamming the kernel log.

This change improves logging correctness and consistency for drivers that need rate-limited warnings.

Dawid Osuchowski (2):
drm/print: add drm_warn_ratelimited logging macro accel/ivpu: Use drm_warn_ratelimited macro

 drivers/accel/ivpu/ivpu_drv.h | 2 +-
 include/drm/drm_print.h       | 3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)

base-commit: 063019ac51afffda4ab3d658701b086caa0c8e9e

Signature · 1 line
2.43.0
#1 lore raw

PATCH RESEND 1/2 drm/print: add drm_warn_ratelimited logging macro

Add a drm_warn_ratelimited() macro to complement the existing drm_err_ratelimited(), providing rate-limited logging at warning level for drivers that need it.

---
 include/drm/drm_print.h | 3 +++
 1 file changed, 3 insertions(+)
include/drm/drm_print.h +3 -0
index 2adc5ac688e1..0805903c093b 100644
@@ -644,6 +644,9 @@ static inline struct device *__drm_to_dev(const struct drm_device *drm)
 #define drm_err_ratelimited(drm, fmt, ...)				\
 	__drm_printk((drm), err, _ratelimited, "*ERROR* " fmt, ##__VA_ARGS__)
 
+#define drm_warn_ratelimited(drm, fmt, ...)				\
+	__drm_printk((drm), warn, _ratelimited, fmt, ##__VA_ARGS__)
+
 
 #define drm_dbg_core(drm, fmt, ...)					\
 	drm_dev_dbg(__drm_to_dev(drm), DRM_UT_CORE, fmt, ##__VA_ARGS__)
Signature · 1 line
2.43.0
maintainer Reviewed-by on v1 1/2
#2 lore raw

Re: [PATCH RESEND 1/2] drm/print: add drm_warn_ratelimited logging macro

Quoted 14 lines · Dawid Osuchowski

Add a drm_warn_ratelimited() macro to complement the existing drm_err_ratelimited(), providing rate-limited logging at warning level for drivers that need it.

---
  include/drm/drm_print.h | 3 +++
  1 file changed, 3 insertions(+)
include/drm/drm_print.h +0 -0
index 2adc5ac688e1..0805903c093b 100644

include/drm/drm_print.h static inline struct device *__drm_to_dev(const struct drm_device *drm) · line 652

Quoted 9 lines
include/drm/drm_print.h +3 -0
@@ -644,6 +644,9 @@ static inline struct device *__drm_to_dev(const struct drm_device *drm)
  #define drm_err_ratelimited(drm, fmt, ...)				\
  	__drm_printk((drm), err, _ratelimited, "*ERROR* " fmt, ##__VA_ARGS__)
 
+#define drm_warn_ratelimited(drm, fmt, ...)				\
+	__drm_printk((drm), warn, _ratelimited, fmt, ##__VA_ARGS__)
+
 
  #define drm_dbg_core(drm, fmt, ...)					\
  	drm_dev_dbg(__drm_to_dev(drm), DRM_UT_CORE, fmt, ##__VA_ARGS__)
#3 lore raw

PATCH RESEND 2/2 accel/ivpu: Use drm_warn_ratelimited macro

In reply to Dawid Osuchowski

Fix ivpu_warn_ratelimited() to properly use WARN logging level instead of an ERROR.

---
 drivers/accel/ivpu/ivpu_drv.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/accel/ivpu/ivpu_drv.h +1 -1
index 86d7c9966cac..8f29f1dc52b9 100644
@@ -91,7 +91,7 @@
 	drm_warn(&(vdev)->drm, "%s(): " fmt, __func__, ##__VA_ARGS__)
 
 #define ivpu_warn_ratelimited(vdev, fmt, ...) \
-	drm_err_ratelimited(&(vdev)->drm, "%s(): " fmt, __func__, ##__VA_ARGS__)
+	drm_warn_ratelimited(&(vdev)->drm, "%s(): " fmt, __func__, ##__VA_ARGS__)
 
 #define ivpu_info(vdev, fmt, ...) drm_info(&(vdev)->drm, fmt, ##__VA_ARGS__)
 
Signature · 1 line
2.43.0
maintainer Reviewed-by on v1 2/2
#4 lore raw

Re: [PATCH RESEND 2/2] accel/ivpu: Use drm_warn_ratelimited macro

Quoted 13 lines · Dawid Osuchowski

Fix ivpu_warn_ratelimited() to properly use WARN logging level instead of an ERROR.

---
  drivers/accel/ivpu/ivpu_drv.h | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/accel/ivpu/ivpu_drv.h +0 -0
index 86d7c9966cac..8f29f1dc52b9 100644

drivers/accel/ivpu/ivpu_drv.h line 97

Quoted 8 lines
drivers/accel/ivpu/ivpu_drv.h +1 -1
@@ -91,7 +91,7 @@
  	drm_warn(&(vdev)->drm, "%s(): " fmt, __func__, ##__VA_ARGS__)
 
  #define ivpu_warn_ratelimited(vdev, fmt, ...) \
-	drm_err_ratelimited(&(vdev)->drm, "%s(): " fmt, __func__, ##__VA_ARGS__)
+	drm_warn_ratelimited(&(vdev)->drm, "%s(): " fmt, __func__, ##__VA_ARGS__)
 
  #define ivpu_info(vdev, fmt, ...) drm_info(&(vdev)->drm, fmt, ##__VA_ARGS__)
 
maintainer
#5 lore raw
In reply to Dawid Osuchowski
Quoted 14 lines · Dawid Osuchowski

This patch set adds drm_warn_ratelimited() to the DRM print helpers and updates the ivpu driver to use the warning-level variant instead of err-level logging. The new helper matches the existing rate-limited logging pattern and gives drivers a consistent way to emit warning messages without spamming the kernel log.

This change improves logging correctness and consistency for drivers that need rate-limited warnings.

Dawid Osuchowski (2):
drm/print: add drm_warn_ratelimited logging macro accel/ivpu: Use drm_warn_ratelimited macro

Quoted 6 lines
  drivers/accel/ivpu/ivpu_drv.h | 2 +-
  include/drm/drm_print.h       | 3 +++
  2 files changed, 4 insertions(+), 1 deletion(-)

base-commit: 063019ac51afffda4ab3d658701b086caa0c8e9e

Thanks.
Applied to drm-misc-next.