drm/atomic: Make sure lock is held in trylock contexts.
authorMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
Thu, 27 Aug 2015 11:58:09 +0000 (13:58 +0200)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Tue, 8 Sep 2015 11:45:53 +0000 (13:45 +0200)
This will make sure we get a lockdep spat in all cases
even if the context is a complete garbage pointer.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/drm_modeset_lock.c

index fba321ca434485d0f6f6d7898c84711eea47a577..6675b14284105cd639fb7fbb7ee9967cfcc38aa9 100644 (file)
@@ -307,6 +307,8 @@ static inline int modeset_lock(struct drm_modeset_lock *lock,
        WARN_ON(ctx->contended);
 
        if (ctx->trylock_only) {
+               lockdep_assert_held(&ctx->ww_ctx);
+
                if (!ww_mutex_trylock(&lock->mutex))
                        return -EBUSY;
                else