[Intel-gfx] [PATCH v2] drm/i915/selftests: Careful not to flush hang_fini on error setups

Tvrtko Ursulin tvrtko.ursulin at linux.intel.com
Mon Jul 29 09:50:56 UTC 2019


On 29/07/2019 09:59, Chris Wilson wrote:
> Smatch spotted that we test at the start of hang_fini for a valid (h->gt
> is only set after a request is created) but then used it regardless
> later on.
> 
> v2: Alternatively, we do not need to check as we now always prime h->gt
> in hang_init()
> 
> Fixes: cb823ed9915b ("drm/i915/gt: Use intel_gt as the primary object for handling resets")

Will the fixes tag cause some unwanted backporting?

But for the change itself:

Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin at intel.com>

Regards,

Tvrtko

> Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
> Cc: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
> Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio at intel.com>
> ---
>   drivers/gpu/drm/i915/gt/selftest_hangcheck.c | 4 +---
>   1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/gt/selftest_hangcheck.c b/drivers/gpu/drm/i915/gt/selftest_hangcheck.c
> index e2fa38a1ff0f..4484b4447db1 100644
> --- a/drivers/gpu/drm/i915/gt/selftest_hangcheck.c
> +++ b/drivers/gpu/drm/i915/gt/selftest_hangcheck.c
> @@ -272,9 +272,7 @@ static u32 hws_seqno(const struct hang *h, const struct i915_request *rq)
>   static void hang_fini(struct hang *h)
>   {
>   	*h->batch = MI_BATCH_BUFFER_END;
> -
> -	if (h->gt)
> -		intel_gt_chipset_flush(h->gt);
> +	intel_gt_chipset_flush(h->gt);
>   
>   	i915_gem_object_unpin_map(h->obj);
>   	i915_gem_object_put(h->obj);
> 


More information about the Intel-gfx mailing list