1
0
Fork 0
alistair23-linux/drivers/dma-buf
Chris Wilson 03e4e0a9e0 dma-buf/fence: Fix lock inversion within dma-fence-array
Ages ago Rob Clark noted,

"Currently with fence-array, we have a potential deadlock situation.  If
we fence_add_callback() on an array-fence, the array-fence's lock is
acquired first, and in it's ->enable_signaling() callback, it will install
cbs on it's array-member fences, so the array-member's lock is acquired
second.

But in the signal path, the array-member's lock is acquired first, and
the array-fence's lock acquired second."

Rob proposed either extensive changes to dma-fence to unnest the
fence-array signaling, or to defer the signaling onto a workqueue. This
is a more refined version of the later, that should keep the latency
of the fence signaling to a minimum by using an irq-work, which is
executed asap.

Reported-by: Rob Clark <robdclark@gmail.com>
Suggested-by: Rob Clark <robdclark@gmail.com>
References: 1476635975-21981-1-git-send-email-robdclark@gmail.com
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Rob Clark <robdclark@gmail.com>
Cc: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Cc: Sumit Semwal <sumit.semwal@linaro.org>
Cc: Christian König <christian.koenig@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20171114162719.30958-1-chris@chris-wilson.co.uk
2017-11-21 22:37:05 +05:30
..
Kconfig dma-buf: Rename struct fence to dma_fence 2016-10-25 14:40:39 +02:00
Makefile dma-buf: Rename struct fence to dma_fence 2016-10-25 14:40:39 +02:00
dma-buf.c dma-buf: Cleanup comments on dma_buf_map_attachment() 2017-11-02 11:10:45 -02:00
dma-fence-array.c dma-buf/fence: Fix lock inversion within dma-fence-array 2017-11-21 22:37:05 +05:30
dma-fence.c Linux 4.13-rc2 2017-07-27 08:15:43 +10:00
reservation.c dma-buf: try to replace a signaled fence in reservation_object_add_shared_inplace 2017-11-14 12:01:45 -05:00
seqno-fence.c dma-buf: Rename struct fence to dma_fence 2016-10-25 14:40:39 +02:00
sw_sync.c dma-buf/sw_sync: force signal all unsignaled fences on dying timeline 2017-09-08 15:30:02 -03:00
sync_debug.c Linux 4.13-rc2 2017-07-27 08:15:43 +10:00
sync_debug.h dma-buf/sw-sync: Use an rbtree to sort fences in the timeline 2017-06-29 18:54:07 -03:00
sync_file.c sync_file: Return consistent status in SYNC_IOC_FILE_INFO 2017-10-09 13:09:19 -03:00
sync_trace.h dma-buf/sw_sync: de-stage SW_SYNC 2016-08-15 16:41:46 +02:00