[Intel-gfx] [PATCH] drm/i915/gem: Check function return in live_nop_switch

Oak Zeng oak.zeng at intel.com
Thu Oct 7 22:55:53 UTC 2021


Fail this test earlier if i915_request_await_dma_fence
fails.

Signed-off-by: Oak Zeng <oak.zeng at intel.com>
---
 drivers/gpu/drm/i915/gem/selftests/i915_gem_context.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/gem/selftests/i915_gem_context.c b/drivers/gpu/drm/i915/gem/selftests/i915_gem_context.c
index b32f7fed2d9c..c0b85e861014 100644
--- a/drivers/gpu/drm/i915/gem/selftests/i915_gem_context.c
+++ b/drivers/gpu/drm/i915/gem/selftests/i915_gem_context.c
@@ -82,7 +82,14 @@ static int live_nop_switch(void *arg)
 				goto out_file;
 			}
 			if (rq) {
-				i915_request_await_dma_fence(this, &rq->fence);
+				if (i915_request_await_dma_fence(this,
+					&rq->fence)) {
+					pr_err("Failed to populate %ld contexts\n", n);
+					intel_gt_set_wedged(to_gt(i915));
+					i915_request_put(rq);
+					err = -EIO;
+					goto out_file;
+				}
 				i915_request_put(rq);
 			}
 			rq = i915_request_get(this);
-- 
2.25.1



More information about the Intel-gfx mailing list