[Intel-gfx] [PATCH 09/13] reservation: Annotate dma_fence waits

Daniel Vetter daniel.vetter at ffwll.ch
Wed Nov 7 15:30:15 UTC 2018


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

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);
-- 
2.19.1



More information about the Intel-gfx mailing list