Re: [PATCH] drm: Take mode_config.mutex in setcrtc ioctl

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

 



On Thu, Apr 6, 2017 at 2:55 PM, Daniel Vetter <daniel.vetter@xxxxxxxx> wrote:
> Legacy drivers insist that we really take all the locks in this path,
> and the harm in doing so is minimal.
>
> Fixes: 2ceb585a956c ("drm: Add explicit acquire ctx handling around ->set_config")
> Cc: Harry Wentland <harry.wentland@xxxxxxx>
> Cc: Daniel Vetter <daniel.vetter@xxxxxxxx>
> Cc: Daniel Vetter <daniel.vetter@xxxxxxxxx>
> Cc: Jani Nikula <jani.nikula@xxxxxxxxxxxxxxx>
> Cc: Sean Paul <seanpaul@xxxxxxxxxxxx>
> Cc: David Airlie <airlied@xxxxxxxx>
> Cc: dri-devel@xxxxxxxxxxxxxxxxxxxxx
> Cc: Alex Deucher <alexdeucher@xxxxxxxxx>
> Reported-by: Alex Deucher <alexdeucher@xxxxxxxxx>
> Signed-off-by: Daniel Vetter <daniel.vetter@xxxxxxxxx>

Acked-and-tested-by: Alex Deucher <alexander.deucher@xxxxxxx>

> ---
>  drivers/gpu/drm/drm_crtc.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
> index d69e180fc563..42257f373c59 100644
> --- a/drivers/gpu/drm/drm_crtc.c
> +++ b/drivers/gpu/drm/drm_crtc.c
> @@ -576,6 +576,7 @@ int drm_mode_setcrtc(struct drm_device *dev, void *data,
>         }
>         DRM_DEBUG_KMS("[CRTC:%d:%s]\n", crtc->base.id, crtc->name);
>
> +       mutex_lock(crtc->dev->mode.config.mutex);
>         drm_modeset_acquire_init(&ctx, 0);
>  retry:
>         ret = drm_modeset_lock_all_ctx(crtc->dev, &ctx);
> @@ -721,6 +722,7 @@ int drm_mode_setcrtc(struct drm_device *dev, void *data,
>         }
>         drm_modeset_drop_locks(&ctx);
>         drm_modeset_acquire_fini(&ctx);
> +       mutex_unlock(crtc->dev->mode.config.mutex);
>
>         return ret;
>  }
> --
> 2.11.0
>
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux