[PATCH] drm/xe: Remove TEST_VM_ASYNC_OPS_ERROR

Maarten Lankhorst maarten.lankhorst at linux.intel.com
Tue Feb 6 11:00:32 UTC 2024


Hey,

This should not have been upstreamed, so lets remove it!

Reviewed-by: Maarten Lankhorst <maarten.lankhorst at linux.intel.com>

On 2024-02-06 05:50, Matthew Brost wrote:
> TEST_VM_ASYNC_OPS_ERROR is broken and unused. Remove for now and will
> pull back in a later time when it is used, fixed, and properly hidden
> behind a Kconfig option. Also fixup the supported flags value.
> 
> Fixes: dd08ebf6c352 ("drm/xe: Introduce a new DRM driver for Intel GPUs"
> Signed-off-by: Matthew Brost <matthew.brost at intel.com>
> ---
>   drivers/gpu/drm/xe/xe_vm.c       | 28 +---------------------------
>   drivers/gpu/drm/xe/xe_vm_types.h |  8 --------
>   2 files changed, 1 insertion(+), 35 deletions(-)
> 
> diff --git a/drivers/gpu/drm/xe/xe_vm.c b/drivers/gpu/drm/xe/xe_vm.c
> index ed594fa2f8da..b49a5065b0e2 100644
> --- a/drivers/gpu/drm/xe/xe_vm.c
> +++ b/drivers/gpu/drm/xe/xe_vm.c
> @@ -37,8 +37,6 @@
>   #include "generated/xe_wa_oob.h"
>   #include "xe_wa.h"
>   
> -#define TEST_VM_ASYNC_OPS_ERROR
> -
>   static struct drm_gem_object *xe_vm_obj(struct xe_vm *vm)
>   {
>   	return vm->gpuvm.r_obj;
> @@ -2065,7 +2063,6 @@ vm_bind_ioctl_ops_create(struct xe_vm *vm, struct xe_bo *bo,
>   	struct drm_gem_object *obj = bo ? &bo->ttm.base : NULL;
>   	struct drm_gpuva_ops *ops;
>   	struct drm_gpuva_op *__op;
> -	struct xe_vma_op *op;
>   	struct drm_gpuvm_bo *vm_bo;
>   	int err;
>   
> @@ -2112,15 +2109,6 @@ vm_bind_ioctl_ops_create(struct xe_vm *vm, struct xe_bo *bo,
>   	if (IS_ERR(ops))
>   		return ops;
>   
> -#ifdef TEST_VM_ASYNC_OPS_ERROR
> -	if (operation & FORCE_ASYNC_OP_ERROR) {
> -		op = list_first_entry_or_null(&ops->list, struct xe_vma_op,
> -					      base.entry);
> -		if (op)
> -			op->inject_error = true;
> -	}
> -#endif
> -
>   	drm_gpuva_for_each_op(__op, ops) {
>   		struct xe_vma_op *op = gpuva_op_to_vma_op(__op);
>   
> @@ -2563,13 +2551,6 @@ static int xe_vma_op_execute(struct xe_vm *vm, struct xe_vma_op *op)
>   
>   	lockdep_assert_held_write(&vm->lock);
>   
> -#ifdef TEST_VM_ASYNC_OPS_ERROR
> -	if (op->inject_error) {
> -		op->inject_error = false;
> -		return -ENOMEM;
> -	}
> -#endif
> -
>   	switch (op->base.op) {
>   	case DRM_GPUVA_OP_MAP:
>   		ret = __xe_vma_op_execute(vm, op->map.vma, op);
> @@ -2729,16 +2710,9 @@ static int vm_bind_ioctl_ops_execute(struct xe_vm *vm,
>   	return 0;
>   }
>   
> -#ifdef TEST_VM_ASYNC_OPS_ERROR
> -#define SUPPORTED_FLAGS	\
> -	(FORCE_ASYNC_OP_ERROR | DRM_XE_VM_BIND_FLAG_READONLY | \
> -	 DRM_XE_VM_BIND_FLAG_IMMEDIATE | DRM_XE_VM_BIND_FLAG_NULL | 0xffff)
> -#else
>   #define SUPPORTED_FLAGS	\
>   	(DRM_XE_VM_BIND_FLAG_READONLY | \
> -	 DRM_XE_VM_BIND_FLAG_IMMEDIATE | DRM_XE_VM_BIND_FLAG_NULL | \
> -	 0xffff)
> -#endif
> +	 DRM_XE_VM_BIND_FLAG_IMMEDIATE | DRM_XE_VM_BIND_FLAG_NULL)
>   #define XE_64K_PAGE_MASK 0xffffull
>   #define ALL_DRM_XE_SYNCS_FLAGS (DRM_XE_SYNCS_FLAG_WAIT_FOR_OP)
>   
> diff --git a/drivers/gpu/drm/xe/xe_vm_types.h b/drivers/gpu/drm/xe/xe_vm_types.h
> index 1fec66ae2eb2..5ac9c5bebabc 100644
> --- a/drivers/gpu/drm/xe/xe_vm_types.h
> +++ b/drivers/gpu/drm/xe/xe_vm_types.h
> @@ -21,9 +21,6 @@ struct xe_bo;
>   struct xe_sync_entry;
>   struct xe_vm;
>   
> -#define TEST_VM_ASYNC_OPS_ERROR
> -#define FORCE_ASYNC_OP_ERROR	BIT(31)
> -
>   #define XE_VMA_READ_ONLY	DRM_GPUVA_USERBITS
>   #define XE_VMA_DESTROYED	(DRM_GPUVA_USERBITS << 1)
>   #define XE_VMA_ATOMIC_PTE_BIT	(DRM_GPUVA_USERBITS << 2)
> @@ -360,11 +357,6 @@ struct xe_vma_op {
>   	/** @flags: operation flags */
>   	enum xe_vma_op_flags flags;
>   
> -#ifdef TEST_VM_ASYNC_OPS_ERROR
> -	/** @inject_error: inject error to test async op error handling */
> -	bool inject_error;
> -#endif
> -
>   	union {
>   		/** @map: VMA map operation specific data */
>   		struct xe_vma_op_map map;


More information about the Intel-xe mailing list