mirror of https://github.com/OpenIPC/firmware.git
36 lines
860 B
Diff
36 lines
860 B
Diff
--- linux-4.9.37/drivers/dma-buf/fence.c 2017-07-12 16:42:41.000000000 +0300
|
|
+++ linux-4.9.y/drivers/dma-buf/fence.c 2021-06-07 13:01:33.000000000 +0300
|
|
@@ -68,6 +68,8 @@
|
|
struct fence_cb *cur, *tmp;
|
|
int ret = 0;
|
|
|
|
+ lockdep_assert_held(fence->lock);
|
|
+
|
|
if (WARN_ON(!fence))
|
|
return -EINVAL;
|
|
|
|
@@ -159,9 +161,6 @@
|
|
if (WARN_ON(timeout < 0))
|
|
return -EINVAL;
|
|
|
|
- if (timeout == 0)
|
|
- return fence_is_signaled(fence);
|
|
-
|
|
trace_fence_wait_start(fence);
|
|
ret = fence->ops->wait(fence, intr, timeout);
|
|
trace_fence_wait_end(fence);
|
|
@@ -304,8 +303,12 @@
|
|
spin_lock_irqsave(fence->lock, flags);
|
|
|
|
ret = !list_empty(&cb->node);
|
|
- if (ret)
|
|
+ if (ret) {
|
|
list_del_init(&cb->node);
|
|
+ if (list_empty(&fence->cb_list))
|
|
+ if (fence->ops->disable_signaling)
|
|
+ fence->ops->disable_signaling(fence);
|
|
+ }
|
|
|
|
spin_unlock_irqrestore(fence->lock, flags);
|
|
|