aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorChunming Zhou <david1.zhou@amd.com>2018-10-23 17:37:45 +0800
committerChristian König <christian.koenig@amd.com>2018-10-23 13:58:56 +0200
commit43cf1fc0e27e2f7eeb5d6c15fd023813a5b49987 (patch)
tree106e58194d9b2ed2d8007a0aad6d134c01eb0657 /include
parentvgaarb: Keep adding VGA device in queue (diff)
downloadlinux-dev-43cf1fc0e27e2f7eeb5d6c15fd023813a5b49987.tar.xz
linux-dev-43cf1fc0e27e2f7eeb5d6c15fd023813a5b49987.zip
drm: fix deadlock of syncobj v6
v2: add a mutex between sync_cb execution and free. v3: clearly separating the roles for pt_lock and cb_mutex (Chris) v4: the cb_mutex should be taken outside of the pt_lock around this if() block. (Chris) v5: fix a corner case v6: tidy drm_syncobj_fence_get_or_add_callback up. (Chris) Tested by syncobj_basic and syncobj_wait of igt. Signed-off-by: Chunming Zhou <david1.zhou@amd.com> Cc: Daniel Vetter <daniel@ffwll.ch> Cc: Chris Wilson <chris@chris-wilson.co.uk> Cc: Christian König <christian.koenig@amd.com> Cc: intel-gfx@lists.freedesktop.org Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Christian König <christian.koenig@amd.com> Link: https://patchwork.kernel.org/patch/10652893/
Diffstat (limited to 'include')
-rw-r--r--include/drm/drm_syncobj.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/include/drm/drm_syncobj.h b/include/drm/drm_syncobj.h
index 5e8c5c027e09..29244cbcd05e 100644
--- a/include/drm/drm_syncobj.h
+++ b/include/drm/drm_syncobj.h
@@ -75,9 +75,13 @@ struct drm_syncobj {
*/
struct list_head cb_list;
/**
- * @lock: Protects syncobj list and write-locks &fence.
+ * @pt_lock: Protects pt list.
*/
- spinlock_t lock;
+ spinlock_t pt_lock;
+ /**
+ * @cb_mutex: Protects syncobj cb list.
+ */
+ struct mutex cb_mutex;
/**
* @file: A file backing for this syncobj.
*/