瀏覽代碼

drm/atomic: Make sure lock is held in trylock contexts.

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>
Maarten Lankhorst 10 年之前
父節點
當前提交
825926d8e0
共有 1 個文件被更改,包括 2 次插入0 次删除
  1. 2 0
      drivers/gpu/drm/drm_modeset_lock.c

+ 2 - 0
drivers/gpu/drm/drm_modeset_lock.c

@@ -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