summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Brost <matthew.brost@intel.com>2023-01-25 10:36:05 -0800
committerRodrigo Vivi <rodrigo.vivi@intel.com>2023-12-19 18:27:46 -0500
commit74a8b2c6e2d6f17fcd9977de298eff20a46b0af7 (patch)
tree2397fdfe0439c01aed5a808f4bad32972c6d70a1
parent332dd0116c82a75df175a459fa69dda3f23491a7 (diff)
drm/xe: Propagate error from bind operations to async fence
If an bind operation fails we need to report it via the async fence. Signed-off-by: Matthew Brost <matthew.brost@intel.com> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Reviewed-by: Niranjana Vishwanathapura <niranjana.vishwanathapura@intel.com>
-rw-r--r--drivers/gpu/drm/xe/xe_vm.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/gpu/drm/xe/xe_vm.c b/drivers/gpu/drm/xe/xe_vm.c
index 4fc8e24f93ce..8ba548e49add 100644
--- a/drivers/gpu/drm/xe/xe_vm.c
+++ b/drivers/gpu/drm/xe/xe_vm.c
@@ -1641,6 +1641,7 @@ err_fences:
struct async_op_fence {
struct dma_fence fence;
+ struct dma_fence *wait_fence;
struct dma_fence_cb cb;
struct xe_vm *vm;
wait_queue_head_t wq;
@@ -1668,8 +1669,10 @@ static void async_op_fence_cb(struct dma_fence *fence, struct dma_fence_cb *cb)
struct async_op_fence *afence =
container_of(cb, struct async_op_fence, cb);
+ afence->fence.error = afence->wait_fence->error;
dma_fence_signal(&afence->fence);
xe_vm_put(afence->vm);
+ dma_fence_put(afence->wait_fence);
dma_fence_put(&afence->fence);
}
@@ -1685,13 +1688,17 @@ static void add_async_op_fence_cb(struct xe_vm *vm,
wake_up_all(&afence->wq);
}
+ afence->wait_fence = dma_fence_get(fence);
afence->vm = xe_vm_get(vm);
dma_fence_get(&afence->fence);
ret = dma_fence_add_callback(fence, &afence->cb, async_op_fence_cb);
- if (ret == -ENOENT)
+ if (ret == -ENOENT) {
+ afence->fence.error = afence->wait_fence->error;
dma_fence_signal(&afence->fence);
+ }
if (ret) {
xe_vm_put(vm);
+ dma_fence_put(afence->wait_fence);
dma_fence_put(&afence->fence);
}
XE_WARN_ON(ret && ret != -ENOENT);