RE: [PATCH] drm/amdgpu: Fix printk_ratelimit() with DRM_ERROR_RATELIMITED in 'amdgpu_cs_ioctl'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



[Public]

Reviewed-by: Guchun Chen <guchun.chen@xxxxxxx>

Regards,
Guchun

> -----Original Message-----
> From: SHANMUGAM, SRINIVASAN <SRINIVASAN.SHANMUGAM@xxxxxxx>
> Sent: Thursday, July 27, 2023 10:33 AM
> To: Koenig, Christian <Christian.Koenig@xxxxxxx>; Deucher, Alexander
> <Alexander.Deucher@xxxxxxx>; Chen, Guchun <Guchun.Chen@xxxxxxx>
> Cc: amd-gfx@xxxxxxxxxxxxxxxxxxxxx; SHANMUGAM, SRINIVASAN
> <SRINIVASAN.SHANMUGAM@xxxxxxx>
> 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@xxxxxxx>
> Cc: Alex Deucher <alexander.deucher@xxxxxxx>
> Signed-off-by: Srinivasan Shanmugam <srinivasan.shanmugam@xxxxxxx>
> ---
>  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





[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux