drm: add drm_warn_ratelimited() and convert ivpu to use it
Subsystems (4)
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
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
@@ -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
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 existingdrm_err_ratelimited(), providing rate-limited logging at warning level for drivers that need it.Signed-off-by Dawid Osuchowski <[email protected]>--- include/drm/drm_print.h | 3 +++ 1 file changed, 3 insertions(+)include/drm/drm_print.h +0
-0
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__)
PATCH RESEND 2/2 accel/ivpu: Use drm_warn_ratelimited macro
In reply to Dawid OsuchowskiFix 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
@@ -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
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.Signed-off-by Dawid Osuchowski <[email protected]>--- drivers/accel/ivpu/ivpu_drv.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/accel/ivpu/ivpu_drv.h +0
-0
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__)
Wachowski, Karol
maintainerQuoted 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: adddrm_warn_ratelimitedlogging macro accel/ivpu: Usedrm_warn_ratelimitedmacro
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.