浏览代码

drm/etnaviv: add lockdep assert to fence allocation

Make sure the GPU lock is taken, so that fence completion order matches
seqno order.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Lucas Stach 8 年之前
父节点
当前提交
b27734c29c
共有 1 个文件被更改,包括 6 次插入0 次删除
  1. 6 0
      drivers/gpu/drm/etnaviv/etnaviv_gpu.c

+ 6 - 0
drivers/gpu/drm/etnaviv/etnaviv_gpu.c

@@ -1051,6 +1051,12 @@ static struct dma_fence *etnaviv_gpu_fence_alloc(struct etnaviv_gpu *gpu)
 {
 	struct etnaviv_fence *f;
 
+	/*
+	 * GPU lock must already be held, otherwise fence completion order might
+	 * not match the seqno order assigned here.
+	 */
+	lockdep_assert_held(&gpu->lock);
+
 	f = kzalloc(sizeof(*f), GFP_KERNEL);
 	if (!f)
 		return NULL;