Skip to content

Commit 56c253d

Browse files
mbrost05Thomas Hellström
authored andcommitted
drm/xe: Fix exec IOCTL long running exec queue ring full condition
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: 8ae8a2e ("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> Reviewed-by: Brian Welty <brian.welty@intel.com> (cherry picked from commit 97d0047) Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
1 parent 7b1a8a5 commit 56c253d

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

drivers/gpu/drm/xe/xe_exec.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ int xe_exec_ioctl(struct drm_device *dev, void *data, struct drm_file *file)
115115
struct xe_sched_job *job;
116116
struct dma_fence *rebind_fence;
117117
struct xe_vm *vm;
118-
bool write_locked;
118+
bool write_locked, skip_retry = false;
119119
ktime_t end = 0;
120120
int err = 0;
121121

@@ -227,7 +227,8 @@ int xe_exec_ioctl(struct drm_device *dev, void *data, struct drm_file *file)
227227
}
228228

229229
if (xe_exec_queue_is_lr(q) && xe_exec_queue_ring_full(q)) {
230-
err = -EWOULDBLOCK;
230+
err = -EWOULDBLOCK; /* Aliased to -EAGAIN */
231+
skip_retry = true;
231232
goto err_exec;
232233
}
233234

@@ -337,7 +338,7 @@ int xe_exec_ioctl(struct drm_device *dev, void *data, struct drm_file *file)
337338
up_write(&vm->lock);
338339
else
339340
up_read(&vm->lock);
340-
if (err == -EAGAIN)
341+
if (err == -EAGAIN && !skip_retry)
341342
goto retry;
342343
err_syncs:
343344
for (i = 0; i < num_syncs; i++)

0 commit comments

Comments
 (0)