Commit 97d0047c authored by Matthew Brost's avatar Matthew Brost
Browse files

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: 8ae8a2e8 ("drm/xe: Long running job update")
Reported-by: default avatarSai Gowtham Ch <sai.gowtham.ch@intel.com>
Signed-off-by: default avatarMatthew Brost <matthew.brost@intel.com>
Reviewed-by: default avatarBrian Welty <brian.welty@intel.com>
parent f4e8ab46
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -154,7 +154,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_retry = false;
	ktime_t end = 0;
	int err = 0;

@@ -265,7 +265,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_retry = true;
		goto err_exec;
	}

@@ -375,7 +376,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_retry)
		goto retry;
err_syncs:
	for (i = 0; i < num_syncs; i++)