[PATCH] drm/xe/vm: Add debug log on pending previous ufence

Nirmoy Das nirmoy.das at intel.com
Tue Oct 29 12:09:56 UTC 2024


Add debug log when a vm_bind fails because corresponding vma still
contains a un-signaled ufence from previous operation.

Cc: Matthew Auld <matthew.auld at intel.com>
Cc: Matthew Brost <matthew.brost at intel.com>
Link: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/3233
Signed-off-by: Nirmoy Das <nirmoy.das at intel.com>
---
 drivers/gpu/drm/xe/xe_vm.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/xe/xe_vm.c b/drivers/gpu/drm/xe/xe_vm.c
index c99380271de6..643415af4ff1 100644
--- a/drivers/gpu/drm/xe/xe_vm.c
+++ b/drivers/gpu/drm/xe/xe_vm.c
@@ -2369,12 +2369,12 @@ static int vma_lock_and_validate(struct drm_exec *exec, struct xe_vma *vma,
 	return err;
 }
 
-static int check_ufence(struct xe_vma *vma)
+static int check_ufence(struct xe_device *xe, struct xe_vma *vma)
 {
 	if (vma->ufence) {
 		struct xe_user_fence * const f = vma->ufence;
 
-		if (!xe_sync_ufence_get_status(f))
+		if (XE_IOCTL_DBG(xe, !xe_sync_ufence_get_status(f)))
 			return -EBUSY;
 
 		vma->ufence = NULL;
@@ -2396,7 +2396,8 @@ static int op_lock_and_prep(struct drm_exec *exec, struct xe_vm *vm,
 					    op->map.immediate);
 		break;
 	case DRM_GPUVA_OP_REMAP:
-		err = check_ufence(gpuva_to_vma(op->base.remap.unmap->va));
+		err = check_ufence(vm->xe,
+				   gpuva_to_vma(op->base.remap.unmap->va));
 		if (err)
 			break;
 
@@ -2409,7 +2410,8 @@ static int op_lock_and_prep(struct drm_exec *exec, struct xe_vm *vm,
 			err = vma_lock_and_validate(exec, op->remap.next, true);
 		break;
 	case DRM_GPUVA_OP_UNMAP:
-		err = check_ufence(gpuva_to_vma(op->base.unmap.va));
+		err = check_ufence(vm->xe,
+				   gpuva_to_vma(op->base.unmap.va));
 		if (err)
 			break;
 
-- 
2.46.0



More information about the Intel-xe mailing list