Commit 019d2600 authored by Mika Kuoppala's avatar Mika Kuoppala Committed by Chris Wilson

drm/i915: Shortcut readiness to reset check

If the engine says it is ready for reset, it is ready
so avoid further dancing and proceed.

v2: reg (Chris)
v3: request, ack, mask from following patch (Chris)

Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: default avatarMika Kuoppala <mika.kuoppala@linux.intel.com>
Reviewed-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Link: https://patchwork.freedesktop.org/patch/msgid/20190412165335.16347-1-mika.kuoppala@linux.intel.com
parent e5604e2f
...@@ -490,20 +490,26 @@ static int gen11_reset_engines(struct drm_i915_private *i915, ...@@ -490,20 +490,26 @@ static int gen11_reset_engines(struct drm_i915_private *i915,
static int gen8_engine_reset_prepare(struct intel_engine_cs *engine) static int gen8_engine_reset_prepare(struct intel_engine_cs *engine)
{ {
struct intel_uncore *uncore = engine->uncore; struct intel_uncore *uncore = engine->uncore;
const i915_reg_t reg = RING_RESET_CTL(engine->mmio_base);
u32 request, mask, ack;
int ret; int ret;
intel_uncore_write_fw(uncore, ack = intel_uncore_read_fw(uncore, reg);
RING_RESET_CTL(engine->mmio_base), if (!(ack & RESET_CTL_READY_TO_RESET)) {
_MASKED_BIT_ENABLE(RESET_CTL_REQUEST_RESET)); request = RESET_CTL_REQUEST_RESET;
mask = RESET_CTL_READY_TO_RESET;
ack = RESET_CTL_READY_TO_RESET;
} else {
return 0;
}
ret = __intel_wait_for_register_fw(uncore, intel_uncore_write_fw(uncore, reg, _MASKED_BIT_ENABLE(request));
RING_RESET_CTL(engine->mmio_base), ret = __intel_wait_for_register_fw(uncore, reg, mask, ack,
RESET_CTL_READY_TO_RESET, 700, 0, NULL);
RESET_CTL_READY_TO_RESET,
700, 0,
NULL);
if (ret) if (ret)
DRM_ERROR("%s: reset request timeout\n", engine->name); DRM_ERROR("%s reset request timed out: {request: %08x, RESET_CTL: %08x}\n",
engine->name, request,
intel_uncore_read_fw(uncore, reg));
return ret; return ret;
} }
......
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