intel-xe.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Cavitt <jonathan.cavitt@intel.com>
To: intel-xe@lists.freedesktop.org
Cc: saurabhg.gupta@intel.com, jonathan.cavitt@intel.com,
	brian.welty@intel.com, tomasz.mistat@intel.com,
	himanshu.girotra@intel.com
Subject: [PATCH] drm/xe/vm: Wait for availability if fault mode is mismatched
Date: Fri,  3 May 2024 12:01:38 -0700	[thread overview]
Message-ID: <20240503190138.1958302-1-jonathan.cavitt@intel.com> (raw)

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@intel.com>
Signed-off-by: Jonathan Cavitt <jonathan.cavitt@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;
-- 
2.25.1


             reply	other threads:[~2024-05-03 19:17 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-03 19:01 Jonathan Cavitt [this message]
2024-05-03 21:51 ` ✓ CI.Patch_applied: success for drm/xe/vm: Wait for availability if fault mode is mismatched Patchwork
2024-05-03 21:51 ` ✗ CI.checkpatch: warning " Patchwork
2024-05-03 21:52 ` ✓ CI.KUnit: success " Patchwork
2024-05-03 22:10 ` ✓ CI.Build: " Patchwork
2024-05-03 22:13 ` ✓ CI.Hooks: " Patchwork
2024-05-03 22:14 ` ✓ CI.checksparse: " Patchwork
2024-05-03 22:51 ` ✓ CI.BAT: " Patchwork
2024-05-04  1:58 ` ✗ CI.FULL: failure " Patchwork
2024-05-08  0:45 ` [PATCH] " Welty, Brian

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=20240503190138.1958302-1-jonathan.cavitt@intel.com \
    --to=jonathan.cavitt@intel.com \
    --cc=brian.welty@intel.com \
    --cc=himanshu.girotra@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=saurabhg.gupta@intel.com \
    --cc=tomasz.mistat@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).