intel-xe.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: "Ghimiray, Himal Prasad" <himal.prasad.ghimiray@intel.com>
To: "Welty, Brian" <brian.welty@intel.com>,
	"intel-xe@lists.freedesktop.org" <intel-xe@lists.freedesktop.org>,
	"Brost, Matthew" <matthew.brost@intel.com>,
	 "Cavitt, Jonathan" <jonathan.cavitt@intel.com>
Subject: RE: [PATCH] drm/xe: Use distinct error code in VM_CREATE for device fault mode checks
Date: Tue, 14 May 2024 14:32:20 +0000	[thread overview]
Message-ID: <MW4PR11MB7056BE62A0ED6EDA912E0EC4B3E32@MW4PR11MB7056.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20240423234707.6587-1-brian.welty@intel.com>

Cc: @Cavitt, Jonathan
> -----Original Message-----
> From: Intel-xe <intel-xe-bounces@lists.freedesktop.org> On Behalf Of Brian
> Welty
> Sent: 24 April 2024 05:17
> To: intel-xe@lists.freedesktop.org; Brost, Matthew
> <matthew.brost@intel.com>
> Subject: [PATCH] drm/xe: Use distinct error code in VM_CREATE for device fault
> mode checks
> 
> vm_create_ioctl doesn't allow creating new VM in fault_mode while existing
> VMs are in non-fault mode, and vice-versa.
> This is not necessarily the user doing anything wrong if others are sharing the
> system. Instead of returning -EINVAL which suggests the user provided a bad
> argument, return distinct error code of -EBUSY for this class of errors so the user
> knows they can retry the vm_create when system is idle.
> 
> Signed-off-by: Brian Welty <brian.welty@intel.com>
> ---
>  drivers/gpu/drm/xe/xe_vm.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/gpu/drm/xe/xe_vm.c b/drivers/gpu/drm/xe/xe_vm.c index
> 85d6f359142d..e8628a982db6 100644
> --- a/drivers/gpu/drm/xe/xe_vm.c
> +++ b/drivers/gpu/drm/xe/xe_vm.c
> @@ -1840,16 +1840,16 @@ int xe_vm_create_ioctl(struct drm_device *dev,
> void *data,
>  			 args->flags &
> DRM_XE_VM_CREATE_FLAG_FAULT_MODE))
>  		return -EINVAL;
> 
> +	if (XE_IOCTL_DBG(xe, args->extensions))
> +		return -EINVAL;
> +
>  	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;
> -
> -	if (XE_IOCTL_DBG(xe, args->extensions))
> -		return -EINVAL;
> +		return -EBUSY;
> 
>  	if (args->flags & DRM_XE_VM_CREATE_FLAG_SCRATCH_PAGE)
>  		flags |= XE_VM_FLAG_SCRATCH_PAGE;
> --
> 2.43.0


  parent reply	other threads:[~2024-05-14 14:32 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-23 23:47 [PATCH] drm/xe: Use distinct error code in VM_CREATE for device fault mode checks Brian Welty
2024-04-23 23:55 ` ✓ CI.Patch_applied: success for " Patchwork
2024-04-23 23:55 ` ✓ CI.checkpatch: " Patchwork
2024-04-23 23:56 ` ✓ CI.KUnit: " Patchwork
2024-04-24  0:16 ` ✓ CI.Build: " Patchwork
2024-04-24  0:19 ` ✓ CI.Hooks: " Patchwork
2024-04-24  0:20 ` ✓ CI.checksparse: " Patchwork
2024-04-24  0:50 ` ✓ CI.BAT: " Patchwork
2024-04-24  3:20 ` [PATCH] " Matthew Brost
2024-05-14 14:32 ` Ghimiray, Himal Prasad [this message]
2024-05-17  4:18 ` Matthew Brost

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=MW4PR11MB7056BE62A0ED6EDA912E0EC4B3E32@MW4PR11MB7056.namprd11.prod.outlook.com \
    --to=himal.prasad.ghimiray@intel.com \
    --cc=brian.welty@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=jonathan.cavitt@intel.com \
    --cc=matthew.brost@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).