Commit 76c5399f authored by Chris Wilson's avatar Chris Wilson

drm/i915/selftests: Careful not to flush hang_fini on error setups

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()

References: cb823ed9 ("drm/i915/gt: Use intel_gt as the primary object for handling resets")
Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Reviewed-by: default avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190729085944.2179-1-chris@chris-wilson.co.uk
parent 62336cc6
...@@ -272,9 +272,7 @@ static u32 hws_seqno(const struct hang *h, const struct i915_request *rq) ...@@ -272,9 +272,7 @@ static u32 hws_seqno(const struct hang *h, const struct i915_request *rq)
static void hang_fini(struct hang *h) static void hang_fini(struct hang *h)
{ {
*h->batch = MI_BATCH_BUFFER_END; *h->batch = MI_BATCH_BUFFER_END;
intel_gt_chipset_flush(h->gt);
if (h->gt)
intel_gt_chipset_flush(h->gt);
i915_gem_object_unpin_map(h->obj); i915_gem_object_unpin_map(h->obj);
i915_gem_object_put(h->obj); i915_gem_object_put(h->obj);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment