Commit 3466a3de authored by Chris Wilson's avatar Chris Wilson

drm/i915/gt: Cleanup heartbeat systole first

Before we grab the engine wakeref, tidy up the previous heartbeat
request. If we then abort because the engine powerwell is off, we ensure
the request is freed as we know we will not have freed it when
cancelling the work (as the work is running!).

Fixes: 841e8672 ("drm/i915/gt: Only drop heartbeat.systole if the sole owner")
References: 058179e7 ("drm/i915/gt: Replace hangcheck by heartbeats")
Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Reviewed-by: default avatarMika Kuoppala <mika.kuoppala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20191106223410.30334-1-chris@chris-wilson.co.uk
parent 70dfbc29
...@@ -63,15 +63,15 @@ static void heartbeat(struct work_struct *wrk) ...@@ -63,15 +63,15 @@ static void heartbeat(struct work_struct *wrk)
struct intel_context *ce = engine->kernel_context; struct intel_context *ce = engine->kernel_context;
struct i915_request *rq; struct i915_request *rq;
if (!intel_engine_pm_get_if_awake(engine))
return;
rq = engine->heartbeat.systole; rq = engine->heartbeat.systole;
if (rq && i915_request_completed(rq)) { if (rq && i915_request_completed(rq)) {
i915_request_put(rq); i915_request_put(rq);
engine->heartbeat.systole = NULL; engine->heartbeat.systole = NULL;
} }
if (!intel_engine_pm_get_if_awake(engine))
return;
if (intel_gt_is_wedged(engine->gt)) if (intel_gt_is_wedged(engine->gt))
goto out; goto out;
......
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