Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/i915: fix i915_gem_object_wait_moving_fence

All of CI is just failing with the following, which prevents loading of
the module:

i915 0000:03:00.0: [drm] *ERROR* Scratch setup failed

Best guess is that this comes from the pin_map() for the scratch page,
which does an i915_gem_object_wait_moving_fence() somewhere. It looks
like this now calls into dma_resv_wait_timeout() which can return the
remaining timeout, leading to the caller thinking this is an error.

v2(Lucas): handle ret == 0

Fixes: 1d7f5e6c5240 ("drm/i915: drop bo->moving dependency")
Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Cc: Christian König <christian.koenig@amd.com>
Cc: Lucas De Marchi <lucas.demarchi@intel.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Christian König <christian.koenig@amd.com> #v1
Link: https://patchwork.freedesktop.org/patch/msgid/20220408084205.1353427-1-matthew.auld@intel.com
Signed-off-by: Christian König <christian.koenig@amd.com>

authored by

Matthew Auld and committed by
Christian König
9362a07a c9cad937

+9 -2
+9 -2
drivers/gpu/drm/i915/gem/i915_gem_object.c
··· 771 771 int i915_gem_object_wait_moving_fence(struct drm_i915_gem_object *obj, 772 772 bool intr) 773 773 { 774 + long ret; 775 + 774 776 assert_object_held(obj); 775 - return dma_resv_wait_timeout(obj->base. resv, DMA_RESV_USAGE_KERNEL, 776 - intr, MAX_SCHEDULE_TIMEOUT); 777 + 778 + ret = dma_resv_wait_timeout(obj->base. resv, DMA_RESV_USAGE_KERNEL, 779 + intr, MAX_SCHEDULE_TIMEOUT); 780 + if (!ret) 781 + ret = -ETIME; 782 + 783 + return ret < 0 ? ret : 0; 777 784 } 778 785 779 786 #if IS_ENABLED(CONFIG_DRM_I915_SELFTEST)