Skip to content

Commit 35aba5f

Browse files
jkrzyszt-intelrodrigovivi
authored andcommitted
drm/i915: Never return 0 if not all requests retired
Users of intel_gt_retire_requests_timeout() expect 0 return value on success. However, we have no protection from passing back 0 potentially returned by a call to dma_fence_wait_timeout() when it succedes right after its timeout has expired. Replace 0 with -ETIME before potentially using the timeout value as return code, so -ETIME is returned if there are still some requests not retired after timeout, 0 otherwise. v3: Use conditional expression, more compact but also better reflecting intention standing behind the change. v2: Move the added lines down so flush_submission() is not affected. Fixes: f33a8a5 ("drm/i915: Merge wait_for_timelines with retire_request") Signed-off-by: Janusz Krzysztofik <[email protected]> Reviewed-by: Andrzej Hajda <[email protected]> Cc: [email protected] # v5.5+ Signed-off-by: Tvrtko Ursulin <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] (cherry picked from commit f301a29) Signed-off-by: Rodrigo Vivi <[email protected]>
1 parent 6a53472 commit 35aba5f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/gpu/drm/i915/gt/intel_gt_requests.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ out_active: spin_lock(&timelines->lock);
199199
if (remaining_timeout)
200200
*remaining_timeout = timeout;
201201

202-
return active_count ? timeout : 0;
202+
return active_count ? timeout ?: -ETIME : 0;
203203
}
204204

205205
static void retire_work_handler(struct work_struct *work)

0 commit comments

Comments
 (0)