diff mbox series

drm/i915/selftests: print exact error code

Message ID 20211021230409.938844-1-oak.zeng@intel.com (mailing list archive)
State New, archived
Headers show
Series drm/i915/selftests: print exact error code | expand

Commit Message

Zeng, Oak Oct. 21, 2021, 11:04 p.m. UTC
Print the exact error code in test live_nop_switch,
instead of -EIO. If the test fails, we will know
the exact reason.

Signed-off-by: Oak Zeng <oak.zeng@intel.com>
---
 drivers/gpu/drm/i915/gem/selftests/i915_gem_context.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

Comments

Zeng, Oak Nov. 11, 2021, 1:37 p.m. UTC | #1
Ping. Can anyone help to review this small patch? 

Regards,
Oak

> -----Original Message-----
> From: Intel-gfx <intel-gfx-bounces@lists.freedesktop.org> On Behalf Of Oak Zeng
> Sent: October 21, 2021 7:04 PM
> To: intel-gfx@lists.freedesktop.org
> Cc: chris@chris-wilson.co.uk
> Subject: [Intel-gfx] [PATCH] drm/i915/selftests: print exact error code
> 
> Print the exact error code in test live_nop_switch,
> instead of -EIO. If the test fails, we will know
> the exact reason.
> 
> Signed-off-by: Oak Zeng <oak.zeng@intel.com>
> ---
>  drivers/gpu/drm/i915/gem/selftests/i915_gem_context.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> 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..5b26cf5f58ad 100644
> --- a/drivers/gpu/drm/i915/gem/selftests/i915_gem_context.c
> +++ b/drivers/gpu/drm/i915/gem/selftests/i915_gem_context.c
> @@ -88,11 +88,12 @@ static int live_nop_switch(void *arg)
>  			rq = i915_request_get(this);
>  			i915_request_add(this);
>  		}
> -		if (i915_request_wait(rq, 0, HZ) < 0) {
> -			pr_err("Failed to populated %d contexts\n", nctx);
> +		err = i915_request_wait(rq, 0, HZ);
> +		if (err < 0) {
> +			pr_err("Failed to populated %d contexts with error %d\n",
> +				nctx, err);
>  			intel_gt_set_wedged(&i915->gt);
>  			i915_request_put(rq);
> -			err = -EIO;
>  			goto out_file;
>  		}
>  		i915_request_put(rq);
> --
> 2.25.1
diff mbox series

Patch

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..5b26cf5f58ad 100644
--- a/drivers/gpu/drm/i915/gem/selftests/i915_gem_context.c
+++ b/drivers/gpu/drm/i915/gem/selftests/i915_gem_context.c
@@ -88,11 +88,12 @@  static int live_nop_switch(void *arg)
 			rq = i915_request_get(this);
 			i915_request_add(this);
 		}
-		if (i915_request_wait(rq, 0, HZ) < 0) {
-			pr_err("Failed to populated %d contexts\n", nctx);
+		err = i915_request_wait(rq, 0, HZ);
+		if (err < 0) {
+			pr_err("Failed to populated %d contexts with error %d\n",
+				nctx, err);
 			intel_gt_set_wedged(&i915->gt);
 			i915_request_put(rq);
-			err = -EIO;
 			goto out_file;
 		}
 		i915_request_put(rq);