]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.14-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 7 Dec 2017 09:52:05 +0000 (10:52 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 7 Dec 2017 09:52:05 +0000 (10:52 +0100)
added patches:
dma-buf-sw_sync-force-signal-all-unsignaled-fences-on-dying-timeline.patch

queue-4.14/dma-buf-sw_sync-force-signal-all-unsignaled-fences-on-dying-timeline.patch [new file with mode: 0644]
queue-4.14/series

diff --git a/queue-4.14/dma-buf-sw_sync-force-signal-all-unsignaled-fences-on-dying-timeline.patch b/queue-4.14/dma-buf-sw_sync-force-signal-all-unsignaled-fences-on-dying-timeline.patch
new file mode 100644 (file)
index 0000000..d38c71d
--- /dev/null
@@ -0,0 +1,50 @@
+From ea4d5a270b57fa8d4871f372ca9b97b7697fdfda Mon Sep 17 00:00:00 2001
+From: Dominik Behr <dbehr@chromium.org>
+Date: Thu, 7 Sep 2017 16:02:46 -0300
+Subject: dma-buf/sw_sync: force signal all unsignaled fences on dying timeline
+
+From: Dominik Behr <dbehr@chromium.org>
+
+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 <chris@chris-wilson.co.uk>
+Signed-off-by: Dominik Behr <dbehr@chromium.org>
+Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.com>
+Link: https://patchwork.freedesktop.org/patch/msgid/20170907190246.16425-2-gustavo@padovan.org
+Cc: Jisheng Zhang <Jisheng.Zhang@synaptics.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ 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);
+       sync_timeline_put(obj);
+       return 0;
index a6c7b35513aae703fb6abd7a6d5aa2aca44dc1a1..020e67dca5932f3eb8dd68690d46cb3d892077c2 100644 (file)
@@ -64,3 +64,4 @@ iio-multiplexer-add-null-check-on-devm_kzalloc-and-devm_kmemdup-return-values.pa
 locking-refcounts-x86-asm-enable-config_arch_has_refcount.patch
 powerpc-jprobes-disable-preemption-when-triggered-through-ftrace.patch
 powerpc-kprobes-disable-preemption-before-invoking-probe-handler-for-optprobes.patch
+dma-buf-sw_sync-force-signal-all-unsignaled-fences-on-dying-timeline.patch