Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/xe: Fix exec IOCTL long running exec queue ring full condition
@ 2024-01-04  8:09 Matthew Brost
  2024-01-04 17:21 ` ✓ CI.Patch_applied: success for " Patchwork
                   ` (7 more replies)
  0 siblings, 8 replies; 10+ messages in thread
From: Matthew Brost @ 2024-01-04  8:09 UTC (permalink / raw)
  To: intel-xe; +Cc: Sai Gowtham Ch

The intent is to return -EWOULDBLOCK to the user if a long running exec
queue is full during the exec IOCTL. -EWOULDBLOCK aliases to -EAGAIN
which results in the exec IOCTL doing a retry loop. Fix this by ensuring
the retry loop is broken when returning -EWOULDBLOCK.

Fixes: 8ae8a2e8dd21 ("drm/xe: Long running job update")
Reported-by: Sai Gowtham Ch <sai.gowtham.ch@intel.com>
Signed-off-by: Matthew Brost <matthew.brost@intel.com>
---
 drivers/gpu/drm/xe/xe_exec.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/xe/xe_exec.c b/drivers/gpu/drm/xe/xe_exec.c
index d30c0d0689bc..c68e1bd15e6a 100644
--- a/drivers/gpu/drm/xe/xe_exec.c
+++ b/drivers/gpu/drm/xe/xe_exec.c
@@ -115,7 +115,7 @@ int xe_exec_ioctl(struct drm_device *dev, void *data, struct drm_file *file)
 	struct xe_sched_job *job;
 	struct dma_fence *rebind_fence;
 	struct xe_vm *vm;
-	bool write_locked;
+	bool write_locked, skip_eagain = false;
 	ktime_t end = 0;
 	int err = 0;
 
@@ -227,7 +227,8 @@ int xe_exec_ioctl(struct drm_device *dev, void *data, struct drm_file *file)
 	}
 
 	if (xe_exec_queue_is_lr(q) && xe_exec_queue_ring_full(q)) {
-		err = -EWOULDBLOCK;
+		err = -EWOULDBLOCK;	/* Aliased to -EAGAIN */
+		skip_eagain = true;
 		goto err_exec;
 	}
 
@@ -337,7 +338,7 @@ int xe_exec_ioctl(struct drm_device *dev, void *data, struct drm_file *file)
 		up_write(&vm->lock);
 	else
 		up_read(&vm->lock);
-	if (err == -EAGAIN)
+	if (err == -EAGAIN && !skip_eagain)
 		goto retry;
 err_syncs:
 	for (i = 0; i < num_syncs; i++)
-- 
2.34.1


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

end of thread, other threads:[~2024-01-05  3:33 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-04  8:09 [PATCH] drm/xe: Fix exec IOCTL long running exec queue ring full condition Matthew Brost
2024-01-04 17:21 ` ✓ CI.Patch_applied: success for " Patchwork
2024-01-04 17:21 ` ✗ CI.checkpatch: warning " Patchwork
2024-01-04 17:22 ` ✓ CI.KUnit: success " Patchwork
2024-01-04 17:30 ` ✓ CI.Build: " Patchwork
2024-01-04 17:30 ` ✓ CI.Hooks: " Patchwork
2024-01-04 17:31 ` ✓ CI.checksparse: " Patchwork
2024-01-04 18:06 ` ✓ CI.BAT: " Patchwork
2024-01-04 21:55 ` [PATCH] " Welty, Brian
2024-01-05  3:32   ` Matthew Brost

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