Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] tests/intel/xe_fault_injection: Use valid pat index
@ 2024-11-21 20:29 Jonathan Cavitt
  2024-11-21 23:42 ` ✓ Xe.CI.BAT: success for " Patchwork
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Jonathan Cavitt @ 2024-11-21 20:29 UTC (permalink / raw)
  To: igt-dev
  Cc: jonathan.cavitt, saurabhg.gupta, alex.zuo, francois.dugast,
	nirmoy.das

As a part of vm_bind_ioctl_check_args, all vm binds that use the
DRM_XE_VM_BIND_OP_MAP_USERPTR operation must have a coherency mode of
XE_COH_AT_LEAST_1WAY.  This is determined by the pat_index set in the
bind operation before the bind is performed.

The value is usually set by intel_get_pat_idx_wb, as this is the
default used in the various xe_vm_bind helper functions (or, more
specifically, the pat index value DEFAULT_PAT_INDEX is passed, which
translates to using intel_get_pat_idx_wb to generate the true value sent
to the ioctl).  However, when the ioctl is called manually (through
igt_ioctl, for example), it is up to the calling test to ensure the pat
index value is correctly set, and in xe_vm, for example,
intel_get_pat_idx_wb is used as well to set the pat index.

This step was not done in the simple_vm_bind function in
xe_fault_injection, so use intel_get_pat_idx_wb to set the pat index.

Closes: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/3499
Signed-off-by: Jonathan Cavitt <jonathan.cavitt@intel.com>
CC: Francois Dugast <francois.dugast@intel.com>
CC: Nirmoy Das <nirmoy.das@intel.com>
---
 tests/intel/xe_fault_injection.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tests/intel/xe_fault_injection.c b/tests/intel/xe_fault_injection.c
index 1b29041745..f8d7278caa 100644
--- a/tests/intel/xe_fault_injection.c
+++ b/tests/intel/xe_fault_injection.c
@@ -17,6 +17,7 @@
 #include "igt_device.h"
 #include "igt_kmod.h"
 #include "igt_sysfs.h"
+#include "intel_pat.h"
 #include "lib/igt_syncobj.h"
 #include "xe/xe_ioctl.h"
 #include "xe/xe_query.h"
@@ -213,6 +214,7 @@ simple_vm_bind(int fd, uint32_t vm)
 		.bind.addr = BO_ADDR,
 		.bind.op = DRM_XE_VM_BIND_OP_MAP_USERPTR,
 		.bind.flags = 0,
+		.bind.pat_index = intel_get_pat_idx_wb(fd),
 		.num_syncs = 1,
 		.syncs = (uintptr_t)&syncobj,
 		.exec_queue_id = 0,
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-11-22 15:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-21 20:29 [PATCH] tests/intel/xe_fault_injection: Use valid pat index Jonathan Cavitt
2024-11-21 23:42 ` ✓ Xe.CI.BAT: success for " Patchwork
2024-11-21 23:54 ` ✗ i915.CI.BAT: failure " Patchwork
2024-11-22 14:46 ` [PATCH] " Francois Dugast
2024-11-22 15:04 ` ✗ Xe.CI.Full: failure for " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox