On 07/10/2021 23:55, Oak Zeng wrote:
Fail this test earlier if i915_request_await_dma_fence fails.
Why only this instance and not the other one in the same function?
Signed-off-by: Oak Zeng <oak.zeng@xxxxxxxxx> --- 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)) {
err = i915_request_await_dma_fence... if (err) So you get the correct error and don't need to assign one below.
+ pr_err("Failed to populate %ld contexts\n", n);
Might as well unique error message.
+ intel_gt_set_wedged(to_gt(i915));
Check your base tree.
+ i915_request_put(rq); + err = -EIO; + goto out_file; + } i915_request_put(rq); } rq = i915_request_get(this);
Regards, Tvrtko