[09/13] reservation: Annotate dma_fence waits
diff mbox series

Message ID 20181107153019.26401-9-daniel.vetter@ffwll.ch
State New
Headers show
Series
  • [01/13] locking/lockdep: restore cross-release checks
Related show

Commit Message

Daniel Vetter Nov. 7, 2018, 3:30 p.m. UTC
reservations have an optimized fastpath that bypasses dma_fence_wait(),
make sure we still catch all dependencies in lockdep.

To avoid lockdep complaining about recursion on the fake
dma_fence_wait lock we use the dma_fence_might_sleep annotation.

Cc: Sumit Semwal <sumit.semwal@linaro.org>
Cc: linux-media@vger.kernel.org
Cc: linaro-mm-sig@lists.linaro.org
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 drivers/dma-buf/reservation.c | 2 ++
 1 file changed, 2 insertions(+)

Patch
diff mbox series

diff --git a/drivers/dma-buf/reservation.c b/drivers/dma-buf/reservation.c
index c1618335ca99..599b88c75cd5 100644
--- a/drivers/dma-buf/reservation.c
+++ b/drivers/dma-buf/reservation.c
@@ -429,6 +429,8 @@  long reservation_object_wait_timeout_rcu(struct reservation_object *obj,
 	long ret = timeout ? timeout : 1;
 	int i;
 
+	dma_fence_might_wait();
+
 retry:
 	shared_count = 0;
 	seq = read_seqcount_begin(&obj->seq);