Skip to content

Commit e339c6d

Browse files
vsyrjalarodrigovivi
authored andcommitted
drm/i915: Retry gtt fault when out of fence registers
If we can't find a free fence register to handle a fault in the GMADR range just return VM_FAULT_NOPAGE without populating the PTE so that userspace will retry the access and trigger another fault. Eventually we should find a free fence and the fault will get properly handled. A further improvement idea might be to reserve a fence (or one per CPU?) for the express purpose of handling faults without having to retry. But that would require some additional work. Looks like this may have gotten broken originally by commit 39965b3 ("drm/i915: don't trash the gtt when running out of fences") as that changed the errno to -EDEADLK which wasn't handle by the gtt fault code either. But later in commit 2feeb52 ("drm/i915/gt: Fix -EDEADLK handling regression") I changed it again to -ENOBUFS as -EDEADLK was now getting used for the ww mutex dance. So this fix only makes sense after that last commit. Cc: [email protected] Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/9479 Fixes: 2feeb52 ("drm/i915/gt: Fix -EDEADLK handling regression") Signed-off-by: Ville Syrjälä <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Reviewed-by: Andi Shyti <[email protected]> (cherry picked from commit 7f403ca) Signed-off-by: Rodrigo Vivi <[email protected]>
1 parent 5e4c16f commit e339c6d

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/gpu/drm/i915/gem/i915_gem_mman.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,7 @@ static vm_fault_t i915_error_to_vmf_fault(int err)
235235
case 0:
236236
case -EAGAIN:
237237
case -ENOSPC: /* transient failure to evict? */
238+
case -ENOBUFS: /* temporarily out of fences? */
238239
case -ERESTARTSYS:
239240
case -EINTR:
240241
case -EBUSY:

0 commit comments

Comments
 (0)