[PATCH] drm/xe/vm: Wait for availability if fault mode is mismatched

Welty, Brian brian.welty at intel.com
Wed May 8 00:45:49 UTC 2024



On 5/3/2024 12:01 PM, Jonathan Cavitt wrote:
> Just because xe_device_in_non_fault_mode (or, equivalently,
> xe_device_in_fault_mode) do not match the requested VM type does not
> mean that running the VM in that mode is invalid.  It only means that
> there presently exists a VM active on the system that does not match the
> requested type.  The VM could be left over from an old test that wasn't
> cleaned up properly, but the more likely cause is that multiple tests
> running concurrently is resulting in the system falsely report that the
> VM fault mode is not supported.
> 
> Instead of saying the VM cannot be created, ask the user to try again later.
> 
> Closes: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/1562
> Suggested-by: Brian Welty: <brian.welty at intel.com>

Hi Jonathan,

When I suggested this I also mentioned I sent the KMD piece out for review:
https://patchwork.freedesktop.org/patch/590930/?series=132803&rev=1

Feedback per Matt B was to discuss with maintainers as apart of larger 
cleanup/review of CREATE ioctl flags.

-Brian


> Signed-off-by: Jonathan Cavitt <jonathan.cavitt at intel.com>
> ---
>   drivers/gpu/drm/xe/xe_vm.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/xe/xe_vm.c b/drivers/gpu/drm/xe/xe_vm.c
> index c0cf531a115d2..8541cfd50730e 100644
> --- a/drivers/gpu/drm/xe/xe_vm.c
> +++ b/drivers/gpu/drm/xe/xe_vm.c
> @@ -2057,11 +2057,11 @@ int xe_vm_create_ioctl(struct drm_device *dev, void *data,
>   
>   	if (XE_IOCTL_DBG(xe, args->flags & DRM_XE_VM_CREATE_FLAG_FAULT_MODE &&
>   			 xe_device_in_non_fault_mode(xe)))
> -		return -EINVAL;
> +		return -EBUSY;
>   
>   	if (XE_IOCTL_DBG(xe, !(args->flags & DRM_XE_VM_CREATE_FLAG_FAULT_MODE) &&
>   			 xe_device_in_fault_mode(xe)))
> -		return -EINVAL;
> +		return -EBUSY;
>   
>   	if (XE_IOCTL_DBG(xe, args->extensions))
>   		return -EINVAL;


More information about the Intel-xe mailing list