All of lore.kernel.org
 help / color / mirror / Atom feed
From: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
To: Daniel Vetter <daniel.vetter@ffwll.ch>,
	DRI Development <dri-devel@lists.freedesktop.org>
Cc: Daniel Vetter <daniel.vetter@intel.com>,
	Intel Graphics Development <intel-gfx@lists.freedesktop.org>,
	Jyri Sarha <jsarha@ti.com>
Subject: Re: [PATCH] drm: Fix locking in drm_atomic_helper_resume
Date: Tue, 30 May 2017 10:11:27 +0200	[thread overview]
Message-ID: <893a555f-ef35-f267-9881-da285677c538@linux.intel.com> (raw)
In-Reply-To: <20170529193409.18752-1-daniel.vetter@ffwll.ch>

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@ti.com>
> Fixes: a5b8444e289c ("drm/atomic-helper: remove modeset_lock_all from helper_resume")
> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> Cc: Daniel Vetter <daniel.vetter@intel.com>
> Cc: Jani Nikula <jani.nikula@linux.intel.com>
> Cc: Sean Paul <seanpaul@chromium.org>
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> ---
> 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@linux.intel.com>

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

  parent reply	other threads:[~2017-05-30  8:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-29 19:34 [PATCH] drm: Fix locking in drm_atomic_helper_resume Daniel Vetter
2017-05-29 19:57 ` ✓ Fi.CI.BAT: success for " Patchwork
2017-05-30  8:11 ` Maarten Lankhorst [this message]
2017-05-31  8:38 [PATCH] " Daniel Vetter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=893a555f-ef35-f267-9881-da285677c538@linux.intel.com \
    --to=maarten.lankhorst@linux.intel.com \
    --cc=daniel.vetter@ffwll.ch \
    --cc=daniel.vetter@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jsarha@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.