@@ -681,3 +681,21 @@ bool dma_resv_test_signaled_rcu(struct dma_resv *obj, bool test_all)
return ret;
}
EXPORT_SYMBOL_GPL(dma_resv_test_signaled_rcu);
+
+/**
+ * dma_resv_sync_user_fence - block for user fences to signal
+ *
+ * @obj: The DMA resv object with the user fence attached
+ *
+ * To make sure we have proper synchronization between accesses block for user
+ * fences before starting a dma_fence based operation on the buffer.
+ */
+int dma_resv_sync_user_fence(struct dma_resv *obj)
+{
+ might_fault();
+
+ /* TODO: Actually come up with an implementation for this! */
+
+ return 0;
+}
+EXPORT_SYMBOL_GPL(dma_resv_sync_user_fence);
@@ -289,5 +289,6 @@ long dma_resv_wait_timeout_rcu(struct dma_resv *obj, bool wait_all, bool intr,
unsigned long timeout);
bool dma_resv_test_signaled_rcu(struct dma_resv *obj, bool test_all);
+int dma_resv_sync_user_fence(struct dma_resv *obj);
#endif /* _LINUX_RESERVATION_H */
This is a RFC/WIP patch which just adds the interface and lockdep annotation without any actual implementation. Signed-off-by: Christian König <christian.koenig@amd.com> --- drivers/dma-buf/dma-resv.c | 18 ++++++++++++++++++ include/linux/dma-resv.h | 1 + 2 files changed, 19 insertions(+)