[PATCH 4/6] drm/amd/display: Fix warning about msleep in amdgpu_dm_helpers.c

Alex Deucher alexdeucher at gmail.com
Thu Jun 29 13:53:17 UTC 2023


On Thu, Jun 29, 2023 at 12:47 AM Srinivasan Shanmugam
<srinivasan.shanmugam at amd.com> wrote:
>
> Fixes the following category of checkpatch warning:
>
> WARNING: msleep < 20ms can sleep for up to 20ms; see Documentation/timers/timers-howto.rst
> +               msleep(10);
>
> Cc: Rodrigo Siqueira <Rodrigo.Siqueira at amd.com>
> Cc: Aurabindo Pillai <aurabindo.pillai at amd.com>
> Signed-off-by: Srinivasan Shanmugam <srinivasan.shanmugam at amd.com>
> ---
>  drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c
> index c13b70629be6..a6be04ad387f 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c
> @@ -643,7 +643,7 @@ static bool execute_synaptics_rc_command(struct drm_dp_aux *aux,
>                 if (rc_cmd == cmd)
>                         // active is 0
>                         break;
> -               msleep(10);
> +               msleep(20);

This doesn't seem like the right fix.  The warning seems somewhat
bogus to begin with.  If the length really matters, I guess we should
use usleep_range(), but if not, I don't see any reason not to leave it
as is.  Sure, it might sleep longer, but it might not.  Better to have
the code stay as is since 10 was presumably the intended sleep time.

Alex


>         }
>
>         // read rc result
> --
> 2.25.1
>


More information about the amd-gfx mailing list