Re: [PATCH] drm: Fix locking in drm_atomic_helper_resume

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

 



Hey,

Op 29-05-17 om 21:34 schreef Daniel Vetter:
> In the conversion to drop drm_modeset_lock_all and the magic implicit
> context I failed to realize that _resume starts out with a pile of
> state copies, but not with the locks. And hence drm_atomic_commit
> won't grab these for us.
>
> Cc: Jyri Sarha <jsarha@xxxxxx>
> Fixes: a5b8444e289c ("drm/atomic-helper: remove modeset_lock_all from helper_resume")
> Cc: Maarten Lankhorst <maarten.lankhorst@xxxxxxxxxxxxxxx>
> Cc: Daniel Vetter <daniel.vetter@xxxxxxxxx>
> Cc: Jani Nikula <jani.nikula@xxxxxxxxxxxxxxx>
> Cc: Sean Paul <seanpaul@xxxxxxxxxxxx>
> Signed-off-by: Daniel Vetter <daniel.vetter@xxxxxxxxx>
> ---
> Needs to be applied to drm-misc-fixes for 4.12.
> -Daniel
> ---
>  drivers/gpu/drm/drm_atomic_helper.c | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
> index af07368846e0..a61291c29567 100644
> --- a/drivers/gpu/drm/drm_atomic_helper.c
> +++ b/drivers/gpu/drm/drm_atomic_helper.c
> @@ -2669,7 +2669,12 @@ int drm_atomic_helper_resume(struct drm_device *dev,
>  
>  	drm_modeset_acquire_init(&ctx, 0);
>  	while (1) {
> +		err = drm_modeset_lock_all_ctx(dev, &ctx);
> +		if (err)
> +			goto out;
> +
>  		err = drm_atomic_helper_commit_duplicated_state(state, &ctx);
> +out:
>  		if (err != -EDEADLK)
>  			break;
>  

This either needs a WARN somewhere to make sure we trip this in the core,
or a big scary comment on why this is needed.

If fixed,
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@xxxxxxxxxxxxxxx>

_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




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