From: Mika Kuoppala <mika.kuoppala@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 2/3] drm/i915: Handle catastrophic error on engine reset
Date: Fri, 12 Apr 2019 18:58:48 +0300 [thread overview]
Message-ID: <87bm1b5i6f.fsf@gaia.fi.intel.com> (raw)
In-Reply-To: <155508415700.28089.18275210102395659911@skylake-alporthouse-com>
Chris Wilson <chris@chris-wilson.co.uk> writes:
> Quoting Mika Kuoppala (2019-04-12 16:37:22)
>> If cat error is set, we need to clear it by acking it. Further,
>> if it is set, we must not do a normal request for reset.
>>
>> Bspec: 12567
>> Signed-off-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
>> ---
>> drivers/gpu/drm/i915/i915_reg.h | 6 +++--
>> drivers/gpu/drm/i915/i915_reset.c | 39 +++++++++++++++++++++----------
>> 2 files changed, 31 insertions(+), 14 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
>> index 8ad2f0a03f28..c1c0f7ab03e9 100644
>> --- a/drivers/gpu/drm/i915/i915_reg.h
>> +++ b/drivers/gpu/drm/i915/i915_reg.h
>> @@ -2446,8 +2446,10 @@ enum i915_power_well_id {
>> #define RING_HWS_PGA(base) _MMIO((base) + 0x80)
>> #define RING_HWS_PGA_GEN6(base) _MMIO((base) + 0x2080)
>> #define RING_RESET_CTL(base) _MMIO((base) + 0xd0)
>> -#define RESET_CTL_REQUEST_RESET (1 << 0)
>> -#define RESET_CTL_READY_TO_RESET (1 << 1)
>> +#define RESET_CTL_CAT_ERROR REG_BIT(2)
>> +#define RESET_CTL_READY_TO_RESET REG_BIT(1)
>> +#define RESET_CTL_REQUEST_RESET REG_BIT(0)
>> +
>> #define RING_SEMA_WAIT_POLL(base) _MMIO((base) + 0x24c)
>>
>> #define HSW_GTT_CACHE_EN _MMIO(0x4024)
>> diff --git a/drivers/gpu/drm/i915/i915_reset.c b/drivers/gpu/drm/i915/i915_reset.c
>> index cde1a5309336..06310ee5a68a 100644
>> --- a/drivers/gpu/drm/i915/i915_reset.c
>> +++ b/drivers/gpu/drm/i915/i915_reset.c
>> @@ -490,25 +490,40 @@ static int gen11_reset_engines(struct drm_i915_private *i915,
>> static int gen8_engine_reset_prepare(struct intel_engine_cs *engine)
>> {
>> struct intel_uncore *uncore = engine->uncore;
>> - u32 ctl;
>> + const i915_reg_t reg = RING_RESET_CTL(engine->mmio_base);
>> + u32 ctl, ack = 0, mask = 0, request = 0;
>> int ret;
>>
>> - ctl = intel_uncore_read_fw(uncore, RING_RESET_CTL(engine->mmio_base));
>> - if (ctl & RESET_CTL_READY_TO_RESET)
>> + ctl = intel_uncore_read_fw(uncore, reg);
>> +
>> + if (INTEL_GEN(engine->i915) > 9 && (ctl & RESET_CTL_CAT_ERROR)) {
>> + request |= RESET_CTL_CAT_ERROR;
>> + mask |= RESET_CTL_CAT_ERROR;
>> +
>> + /* HAS#396813: Avoid reset request if cat error */
>> + goto skip_ready_req;
>> + }
>
> Doesn't look like you need a goto here.
>
> if (ctl & CAT_ERROR) { /* CAT_ERROR shouldn't be raised on gen8-9 */
> request = RESET_CTL_CAT_ERROR;
> mask = RESET_CTL_CAT_ERROR;
> } else if (!(ctl & RESET_CTL_READY_TO_RESET))) {
> request = RESET_CTL_REQUEST_RESET;
> mask = RESET_CTL_READY_TO_RESET;
> ack = RESET_CTL_READY_TO_RESET;
> } else {
> return 0;
> }
>
> Right?
Right no goto needed and ta for writing it out above.
The bit was 'reserved' on previous gen but we can safely assumed
it is zero and stay such.
-Mika
>
>> +
>> + if (!(ctl & RESET_CTL_READY_TO_RESET)) {
>> + request |= RESET_CTL_REQUEST_RESET;
>> +
>> + mask |= RESET_CTL_READY_TO_RESET;
>> + ack |= RESET_CTL_READY_TO_RESET;
>> + }
>> +
>> + if (!request)
>> return 0;
>>
>> - intel_uncore_write_fw(uncore,
>> - RING_RESET_CTL(engine->mmio_base),
>> - _MASKED_BIT_ENABLE(RESET_CTL_REQUEST_RESET));
>> +skip_ready_req:
>> + intel_uncore_write_fw(uncore, reg, _MASKED_BIT_ENABLE(request));
>>
>> ret = __intel_wait_for_register_fw(uncore,
>> - RING_RESET_CTL(engine->mmio_base),
>> - RESET_CTL_READY_TO_RESET,
>> - RESET_CTL_READY_TO_RESET,
>> - 700, 0,
>> - NULL);
>> + reg, mask, ack,
>> + 700, 0, NULL);
>> if (ret)
>> - DRM_ERROR("%s: reset request timeout\n", engine->name);
>> + DRM_ERROR("%s: reset request 0x%08x timeout 0x%08x\n",
>> + engine->name, request,
>> + intel_uncore_read_fw(uncore, reg));
>
> Interesting, the only quible I have is with "request". But it works well
> enough in context.
> -Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2019-04-12 15:59 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-12 15:37 [PATCH 1/3] drm/i915: Shortcut readiness to reset check Mika Kuoppala
2019-04-12 15:37 ` [PATCH 2/3] drm/i915: Handle catastrophic error on engine reset Mika Kuoppala
2019-04-12 15:49 ` Chris Wilson
2019-04-12 15:58 ` Mika Kuoppala [this message]
2019-04-12 15:37 ` [PATCH 3/3] drm/i915: Log catastrophic errors on gen11 Mika Kuoppala
2019-04-12 15:42 ` Chris Wilson
2019-04-12 15:47 ` Mika Kuoppala
2019-04-12 15:53 ` Chris Wilson
2019-04-12 15:51 ` [PATCH 1/3] drm/i915: Shortcut readiness to reset check Chris Wilson
2019-04-12 15:54 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [1/3] " Patchwork
2019-04-12 16:32 ` ✓ Fi.CI.BAT: success " Patchwork
2019-04-12 19:38 ` ✓ Fi.CI.IGT: " Patchwork
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87bm1b5i6f.fsf@gaia.fi.intel.com \
--to=mika.kuoppala@linux.intel.com \
--cc=chris@chris-wilson.co.uk \
--cc=intel-gfx@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.