From: Mika Kuoppala <mika.kuoppala@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>,
Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH v2] drm/i915: Assert that the context-switch completion matches our context
Date: Mon, 23 Jan 2017 13:18:59 +0200 [thread overview]
Message-ID: <874m0qausc.fsf@gaia.fi.intel.com> (raw)
In-Reply-To: <20170123105259.GS17136@nuc-i3427.alporthouse.com>
Chris Wilson <chris@chris-wilson.co.uk> writes:
> On Mon, Jan 23, 2017 at 10:44:03AM +0000, Tvrtko Ursulin wrote:
>>
>> On 23/01/2017 10:30, Chris Wilson wrote:
>> >On Mon, Jan 23, 2017 at 10:26:15AM +0000, Tvrtko Ursulin wrote:
>> >>
>> >>On 23/01/2017 08:50, Chris Wilson wrote:
>> >>>When execlists signals the context completion, it also provides the
>> >>>context id for the status event. Assert that id matches the one we expect.
>> >>>
>> >>>v2: The upper dword of the context status is a duplicate of the upper
>> >>>dword from elsp submission (i.e. includes the group id as well as the
>> >>>context id). Include this check as well.
>> >>>
>> >>>Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
>> >>>Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
>> >>>---
>> >>>drivers/gpu/drm/i915/intel_lrc.c | 6 ++++++
>> >>>1 file changed, 6 insertions(+)
>> >>>
>> >>>diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c
>> >>>index 432ee495dec2..963b1888d8a0 100644
>> >>>--- a/drivers/gpu/drm/i915/intel_lrc.c
>> >>>+++ b/drivers/gpu/drm/i915/intel_lrc.c
>> >>>@@ -595,6 +595,12 @@ static void intel_lrc_irq_handler(unsigned long data)
>> >>> if (!(status & GEN8_CTX_STATUS_COMPLETED_MASK))
>> >>> continue;
>> >>>
>> >>>+ /* Check the context/desc id for this event matches */
>> >>>+ GEM_BUG_ON(((readl(buf + 2 * idx + 1) & (MAX_CONTEXT_HW_ID-1)) !=
>> >>>+ port[0].request->ctx->hw_id));
>> >>>+ GEM_BUG_ON(readl(buf + 2 * idx + 1) !=
>> >>>+ upper_32_bits(port[0].request->ctx->engine[engine->id].lrc_desc));
>> >>>+
>> >>
>> >>Not sure that you need the first line since the lrc_desc includes
>> >>the hw_id? Or perhaps you don't need the second one since lrc_desc
>> >>is built from hw_id? :)
>> >
>> >It was defense in depth :)
>> >
>> >The first line is certain, that make sure the event matches
>> >port[0].request.
>> >
>> >The second line makes sure that everything matches my understanding, and
>> >that lrc_desc is correct (or vice versa).
>>
>> Too redundant IMO. lrc_desc correctness could/should be asserted
>> somewhere else, not in the irq handler. I would keep one of them,
>> probably the assert agains lrc_desc because that's the right layer
>> for this place.
>
> Preemptive r-b on the second then? Joonas?
I feel like coming late into party uninvited, but
you can add mine for the whole lrc_desc check.
-Mika
> -Chris
>
> --
> Chris Wilson, Intel Open Source Technology Centre
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2017-01-23 11:19 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-21 17:29 [PATCH 1/2] drm/i915: Assert that the kernel_context is hw-id 0 Chris Wilson
2017-01-21 17:29 ` [PATCH 2/2] drm/i915: Assert that the context-switch completion matches our context Chris Wilson
2017-01-23 8:26 ` Joonas Lahtinen
2017-01-23 8:32 ` Chris Wilson
2017-01-23 8:50 ` [PATCH v2] " Chris Wilson
2017-01-23 10:26 ` Tvrtko Ursulin
2017-01-23 10:30 ` Chris Wilson
2017-01-23 10:44 ` Tvrtko Ursulin
2017-01-23 10:52 ` Chris Wilson
2017-01-23 11:18 ` Mika Kuoppala [this message]
2017-01-21 17:54 ` ✓ Fi.CI.BAT: success for series starting with [1/2] drm/i915: Assert that the kernel_context is hw-id 0 Patchwork
2017-01-23 8:07 ` [PATCH 1/2] " Joonas Lahtinen
2017-01-23 10:23 ` ✓ Fi.CI.BAT: success for series starting with [1/2] drm/i915: Assert that the kernel_context is hw-id 0 (rev2) 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=874m0qausc.fsf@gaia.fi.intel.com \
--to=mika.kuoppala@linux.intel.com \
--cc=chris@chris-wilson.co.uk \
--cc=intel-gfx@lists.freedesktop.org \
--cc=tvrtko.ursulin@linux.intel.com \
/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.