From: Jonathan Cavitt <jonathan.cavitt@intel.com>
To: igt-dev@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 i-g-t 1/1] lib/xe/xe_query: Wait for xe_supports_faults
Date: Fri, 3 May 2024 12:37:14 -0700 [thread overview]
Message-ID: <20240503193714.1967850-2-jonathan.cavitt@intel.com> (raw)
In-Reply-To: <20240503193714.1967850-1-jonathan.cavitt@intel.com>
It's possible for xe_supports_faults to return false if the system is
busy with multiple running tests. This is because the check looks for
all active VMs and searches for VMs that do not have faults enabled,
returning false if any exist. Recently, this check has been changed to
return EBUSY when the check fails in this way, so wait for up to ten
seconds for all the active VMs to flush out before proceeding.
Suggested-by: Brian Welty <brian.welty@intel.com>
Signed-off-by: Jonathan Cavitt <jonathan.cavitt@intel.com>
---
lib/xe/xe_query.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/lib/xe/xe_query.c b/lib/xe/xe_query.c
index 6df8f42649..5458c73417 100644
--- a/lib/xe/xe_query.c
+++ b/lib/xe/xe_query.c
@@ -314,8 +314,13 @@ bool xe_supports_faults(int fd)
.flags = DRM_XE_VM_CREATE_FLAG_LR_MODE |
DRM_XE_VM_CREATE_FLAG_FAULT_MODE,
};
-
- supports_faults = !igt_ioctl(fd, DRM_IOCTL_XE_VM_CREATE, &create);
+ struct timespec tv = {};
+ int result, timeout;
+ do {
+ result = igt_ioctl(fd, DRM_IOCTL_XE_VM_CREATE, &create);
+ supports_faults = !result;
+ timeout = igt_seconds_elapsed(&tv);
+ } while (result == -EBUSY && timeout < 10);
if (supports_faults)
xe_vm_destroy(fd, create.vm_id);
--
2.25.1
next prev parent reply other threads:[~2024-05-03 19:52 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-03 19:37 [PATCH i-g-t 0/1] lib/xe/xe_query: Wait for xe_supports_faults Jonathan Cavitt
2024-05-03 19:37 ` Jonathan Cavitt [this message]
2024-05-08 16:23 ` [PATCH i-g-t 1/1] " Kamil Konieczny
2024-05-08 16:43 ` Cavitt, Jonathan
2024-05-08 17:11 ` Kamil Konieczny
2024-05-09 1:27 ` Welty, Brian
2024-05-09 14:27 ` Cavitt, Jonathan
2024-05-03 20:31 ` ✓ Fi.CI.BAT: success for " Patchwork
2024-05-03 20:47 ` ✓ CI.xeBAT: " Patchwork
2024-05-03 23:16 ` ✗ CI.xeFULL: failure " Patchwork
2024-05-04 7:50 ` ✗ Fi.CI.IGT: " Patchwork
-- strict thread matches above, loose matches on Subject: below --
2024-05-08 19:35 [PATCH i-g-t 0/1] " Jonathan Cavitt
2024-05-08 19:35 ` [PATCH i-g-t 1/1] " Jonathan Cavitt
2024-05-09 16:20 ` Kamil Konieczny
2024-05-09 16:30 ` Cavitt, Jonathan
2024-05-10 15:58 ` Kamil Konieczny
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=20240503193714.1967850-2-jonathan.cavitt@intel.com \
--to=jonathan.cavitt@intel.com \
--cc=brian.welty@intel.com \
--cc=himanshu.girotra@intel.com \
--cc=igt-dev@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