drm/xe: Use migrate engine for page fault binds
authorMatthew Brost <matthew.brost@intel.com>
Fri, 21 Jul 2023 19:16:13 +0000 (12:16 -0700)
committerRodrigo Vivi <rodrigo.vivi@intel.com>
Thu, 21 Dec 2023 16:37:53 +0000 (11:37 -0500)
We must use migrate engine for page fault binds in order to avoid a
deadlock as the migrate engine has a reserved BCS instance which cannot
be stuck on a fault. To use the migrate engine the engine argument to
xe_migrate_update_pgtables must be NULL, this was incorrectly wired up
so vm->eng[tile_id] was always being used. Fix this.

Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Matthew Brost <matthew.brost@intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
drivers/gpu/drm/xe/xe_pt.c
drivers/gpu/drm/xe/xe_vm.c

index b67144768af05ca885f35d91a306389a1149c4f3..d2df51910010803299db31e6635fa27fdc5bd3f6 100644 (file)
@@ -1421,8 +1421,7 @@ __xe_pt_bind_vma(struct xe_tile *tile, struct xe_vma *vma, struct xe_engine *e,
        }
 
        fence = xe_migrate_update_pgtables(tile->migrate,
-                                          vm, xe_vma_bo(vma),
-                                          e ? e : vm->eng[tile->id],
+                                          vm, xe_vma_bo(vma), e,
                                           entries, num_entries,
                                           syncs, num_syncs,
                                           &bind_pt_update.base);
index a07dc4f846b1be95e9bc91ddb4350bd6b16b57ec..f3f6f01046a94c5ff6030431be0d25dd85556107 100644 (file)
@@ -1675,7 +1675,8 @@ xe_vm_bind_vma(struct xe_vma *vma, struct xe_engine *e,
                if (!(vma->tile_mask & BIT(id)))
                        goto next;
 
-               fence = __xe_pt_bind_vma(tile, vma, e, first_op ? syncs : NULL,
+               fence = __xe_pt_bind_vma(tile, vma, e ? e : vm->eng[id],
+                                        first_op ? syncs : NULL,
                                         first_op ? num_syncs : 0,
                                         vma->tile_present & BIT(id));
                if (IS_ERR(fence)) {