[lkml]   [2017]   [Dec]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH 4.14 67/75] dma-buf/sw_sync: force signal all unsignaled fences on dying timeline
4.14-stable review patch.  If anyone has any objections, please let me know.


From: Dominik Behr <>

commit ea4d5a270b57fa8d4871f372ca9b97b7697fdfda upstream.

To avoid hanging userspace components that might have been waiting on the
active fences of the destroyed timeline we need to signal with error all
remaining fences on such timeline.

This restore the default behaviour of the Android sw_sync framework, which
Android still relies on. It was broken on the dma fence conversion a few
years ago and never fixed.

v2: Do not bother with cleanup do the list (Chris Wilson)

Reviewed-by: Chris Wilson <>
Signed-off-by: Dominik Behr <>
Signed-off-by: Gustavo Padovan <>
Cc: Jisheng Zhang <>
Signed-off-by: Greg Kroah-Hartman <>

drivers/dma-buf/sw_sync.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)

--- a/drivers/dma-buf/sw_sync.c
+++ b/drivers/dma-buf/sw_sync.c
@@ -321,8 +321,16 @@ static int sw_sync_debugfs_open(struct i
static int sw_sync_debugfs_release(struct inode *inode, struct file *file)
struct sync_timeline *obj = file->private_data;
+ struct sync_pt *pt, *next;

- smp_wmb();
+ spin_lock_irq(&obj->lock);
+ list_for_each_entry_safe(pt, next, &obj->pt_list, link) {
+ dma_fence_set_error(&pt->base, -ENOENT);
+ dma_fence_signal_locked(&pt->base);
+ }
+ spin_unlock_irq(&obj->lock);

return 0;

 \ /
  Last update: 2017-12-07 14:21    [W:0.302 / U:0.336 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site