[Intel-xe] [PATCH] drm/xe: Use migrate engine for page fault binds

Rodrigo Vivi rodrigo.vivi at intel.com
Fri Jul 21 21:35:58 UTC 2023


On Fri, Jul 21, 2023 at 12:21:52PM -0700, Matthew Brost wrote:
> 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.

it makes sense according to the xe_migrate_update_pgtables doc.

Reviewed-by: Rodrigo Vivi <rodrigo.vivi at intel.com>


> 
> Signed-off-by: Matthew Brost <matthew.brost at intel.com>
> ---
>  drivers/gpu/drm/xe/xe_pt.c | 3 +--
>  drivers/gpu/drm/xe/xe_vm.c | 3 ++-
>  2 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/xe/xe_pt.c b/drivers/gpu/drm/xe/xe_pt.c
> index 457f1363ec67..bbc319fba9e8 100644
> --- a/drivers/gpu/drm/xe/xe_pt.c
> +++ b/drivers/gpu/drm/xe/xe_pt.c
> @@ -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);
> diff --git a/drivers/gpu/drm/xe/xe_vm.c b/drivers/gpu/drm/xe/xe_vm.c
> index 6003c0be5b59..62a99c393d6b 100644
> --- a/drivers/gpu/drm/xe/xe_vm.c
> +++ b/drivers/gpu/drm/xe/xe_vm.c
> @@ -1678,7 +1678,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)) {
> -- 
> 2.34.1
> 


More information about the Intel-xe mailing list