[PATCH] drm/i915/selftests: Add some missing error propagation

Andi Shyti andi.shyti at linux.intel.com
Mon Jun 5 13:47:30 UTC 2023


Hi Tvrtko,

> Add some missing error propagation in live_parallel_switch.
> 
> To avoid needlessly burdening the various backport processes, note I am
> not marking it as a fix against any patches and not copying stable since
> it is debug/selftests only code.

which I did :/

But I guess you are right and it's not necessary.

> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
> Reported-by: Dan Carpenter <dan.carpenter at linaro.org>
> Cc: Andi Shyti <andi.shyti at linux.intel.com>
> ---
>  .../gpu/drm/i915/gem/selftests/i915_gem_context.c  | 14 ++++++++++----
>  1 file changed, 10 insertions(+), 4 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 ad6a3b2fb387..7021b6e9b219 100644
> --- a/drivers/gpu/drm/i915/gem/selftests/i915_gem_context.c
> +++ b/drivers/gpu/drm/i915/gem/selftests/i915_gem_context.c
> @@ -348,8 +348,10 @@ static int live_parallel_switch(void *arg)
>  				continue;
>  
>  			ce = intel_context_create(data[m].ce[0]->engine);
> -			if (IS_ERR(ce))
> +			if (IS_ERR(ce)) {
> +				err = PTR_ERR(ce);
>  				goto out;
> +			}
>  
>  			err = intel_context_pin(ce);
>  			if (err) {
> @@ -369,8 +371,10 @@ static int live_parallel_switch(void *arg)
>  
>  		worker = kthread_create_worker(0, "igt/parallel:%s",
>  					       data[n].ce[0]->engine->name);
> -		if (IS_ERR(worker))
> +		if (IS_ERR(worker)) {
> +			err = PTR_ERR(worker);
>  			goto out;
> +		}
>  
>  		data[n].worker = worker;
>  	}
> @@ -399,8 +403,10 @@ static int live_parallel_switch(void *arg)
>  			}
>  		}
>  
> -		if (igt_live_test_end(&t))
> -			err = -EIO;
> +		if (igt_live_test_end(&t)) {
> +			err = err ?: -EIO;

Nice catch!

Reviewed-by: Andi Shyti <andi.shyti at linux.intel.com> 

Andi

> +			break;
> +		}
>  	}
>  
>  out:
> -- 
> 2.39.2


More information about the dri-devel mailing list