[PATCH] drm/amdgpu: Fix printk_ratelimit() with DRM_ERROR_RATELIMITED in 'amdgpu_cs_ioctl'
Chen, Guchun
Guchun.Chen at amd.com
Fri Jul 28 09:51:42 UTC 2023
[Public]
Reviewed-by: Guchun Chen <guchun.chen at amd.com>
Regards,
Guchun
> -----Original Message-----
> From: SHANMUGAM, SRINIVASAN <SRINIVASAN.SHANMUGAM at amd.com>
> Sent: Thursday, July 27, 2023 10:33 AM
> To: Koenig, Christian <Christian.Koenig at amd.com>; Deucher, Alexander
> <Alexander.Deucher at amd.com>; Chen, Guchun <Guchun.Chen at amd.com>
> Cc: amd-gfx at lists.freedesktop.org; SHANMUGAM, SRINIVASAN
> <SRINIVASAN.SHANMUGAM at amd.com>
> Subject: [PATCH] drm/amdgpu: Fix printk_ratelimit() with
> DRM_ERROR_RATELIMITED in 'amdgpu_cs_ioctl'
>
> Replaced printk_ratelimit() with its DRM equivalent to avoid flooding of
> dmesg logs & hence fixes the following:
>
> WARNING: Prefer printk_ratelimited or pr_<level>_ratelimited to
> printk_ratelimit
> + if (printk_ratelimit())
>
> Cc: Christian König <christian.koenig at amd.com>
> Cc: Alex Deucher <alexander.deucher at amd.com>
> Signed-off-by: Srinivasan Shanmugam <srinivasan.shanmugam at amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
> index 040f4cb6ab2d..a3bae98c7803 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
> @@ -1430,8 +1430,7 @@ int amdgpu_cs_ioctl(struct drm_device *dev, void
> *data, struct drm_file *filp)
>
> r = amdgpu_cs_parser_init(&parser, adev, filp, data);
> if (r) {
> - if (printk_ratelimit())
> - DRM_ERROR("Failed to initialize parser %d!\n", r);
> + DRM_ERROR_RATELIMITED("Failed to initialize parser %d!\n",
> r);
> return r;
> }
>
> --
> 2.25.1
More information about the amd-gfx
mailing list