Skip to content

Commit 2feeb52

Browse files
vsyrjalarodrigovivi
authored andcommitted
drm/i915/gt: Fix -EDEADLK handling regression
The conversion to ww mutexes failed to address the fence code which already returns -EDEADLK when we run out of fences. Ww mutexes on the other hand treat -EDEADLK as an internal errno value indicating a need to restart the operation due to a deadlock. So now when the fence code returns -EDEADLK the higher level code erroneously restarts everything instead of returning the error to userspace as is expected. To remedy this let's switch the fence code to use a different errno value for this. -ENOBUFS seems like a semi-reasonable unique choice. Apart from igt the only user of this I could find is sna, and even there all we do is dump the current fence registers from debugfs into the X server log. So no user visible functionality is affected. If we really cared about preserving this we could of course convert back to -EDEADLK higher up, but doesn't seem like that's worth the hassle here. Not quite sure which commit specifically broke this, but I'll just attribute it to the general gem ww mutex work. Cc: [email protected] Cc: Maarten Lankhorst <[email protected]> Cc: Thomas Hellström <[email protected]> Testcase: igt/gem_pread/exhaustion Testcase: igt/gem_pwrite/basic-exhaustion Testcase: igt/gem_fenced_exec_thrash/too-many-fences Fixes: 80f0b67 ("drm/i915: Add an implementation for i915_gem_ww_ctx locking, v2.") Signed-off-by: Ville Syrjälä <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Reviewed-by: Maarten Lankhorst <[email protected]> (cherry picked from commit 78d2ad7) Signed-off-by: Rodrigo Vivi <[email protected]>
1 parent e73f0f0 commit 2feeb52

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ static struct i915_fence_reg *fence_find(struct i915_ggtt *ggtt)
348348
if (intel_has_pending_fb_unpin(ggtt->vm.i915))
349349
return ERR_PTR(-EAGAIN);
350350

351-
return ERR_PTR(-EDEADLK);
351+
return ERR_PTR(-ENOBUFS);
352352
}
353353

354354
int __i915_vma_pin_fence(struct i915_vma *vma)

0 commit comments

Comments
 (0)