From: Mika Kuoppala <mika.kuoppala@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH v2] drm/i915/selftests: Include the trace as a debug aide
Date: Thu, 22 Mar 2018 16:26:41 +0200 [thread overview]
Message-ID: <87a7v05gpq.fsf@gaia.fi.intel.com> (raw)
In-Reply-To: <20180322074908.10838-1-chris@chris-wilson.co.uk>
Chris Wilson <chris@chris-wilson.co.uk> writes:
> If we fail to reset the GPU in a timely fashion, dump the GEM trace so
> that we can see what operations were in flight when the GPU got stuck.
>
> v2: There's more than one timeout that deserves tracing!
> v3: Silence checkpatch by not even using a product at all!
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> ---
> drivers/gpu/drm/i915/selftests/intel_hangcheck.c | 23 ++++++++++++++++++++---
> 1 file changed, 20 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/selftests/intel_hangcheck.c b/drivers/gpu/drm/i915/selftests/intel_hangcheck.c
> index 4372826998aa..9b235dae8dd9 100644
> --- a/drivers/gpu/drm/i915/selftests/intel_hangcheck.c
> +++ b/drivers/gpu/drm/i915/selftests/intel_hangcheck.c
> @@ -260,8 +260,11 @@ static void wedge_me(struct work_struct *work)
> {
> struct wedge_me *w = container_of(work, typeof(*w), work.work);
>
> - pr_err("%pS timed out, cancelling all further testing.\n",
> - w->symbol);
> + pr_err("%pS timed out, cancelling all further testing.\n", w->symbol);
> +
> + GEM_TRACE("%pS timed out.\n", w->symbol);
> + GEM_TRACE_DUMP();
> +
> i915_gem_set_wedged(w->i915);
> }
>
> @@ -621,9 +624,19 @@ static int active_engine(void *data)
> mutex_unlock(&engine->i915->drm.struct_mutex);
>
> if (old) {
> - i915_request_wait(old, 0, MAX_SCHEDULE_TIMEOUT);
> + if (i915_request_wait(old, 0, HZ) < 0) {
> + GEM_TRACE("%s timed out.\n", engine->name);
> + GEM_TRACE_DUMP();
> +
> + i915_gem_set_wedged(engine->i915);
> + i915_request_put(old);
> + err = -EIO;
> + break;
> + }
Using err = i915_request_wait() could have saved one extra request_put
but I dunno if it would be any cleaner.
> i915_request_put(old);
> }
> +
> + cond_resched();
To give more slack for other engines and main thread to proceed?
> }
>
> for (count = 0; count < ARRAY_SIZE(rq); count++)
> @@ -1126,6 +1139,10 @@ int intel_hangcheck_live_selftests(struct drm_i915_private *i915)
>
> err = i915_subtests(tests, i915);
>
> + mutex_lock(&i915->drm.struct_mutex);
> + flush_test(i915, I915_WAIT_LOCKED);
> + mutex_unlock(&i915->drm.struct_mutex);
> +
To wash out leftovers.
Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
> i915_modparams.enable_hangcheck = saved_hangcheck;
> intel_runtime_pm_put(i915);
>
> --
> 2.16.2
>
> _______________________________________________
> 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:[~2018-03-22 14:26 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-22 7:35 [PATCH 1/4] drm/i915/selftests: Include the trace as a debug aide Chris Wilson
2018-03-22 7:35 ` [PATCH 2/4] drm/i915/selftests: Stress resets-vs-request-priority Chris Wilson
2018-03-22 7:35 ` [PATCH 3/4] drm/i915: Use full serialisation around engine->irq_posted Chris Wilson
2018-03-22 14:35 ` Mika Kuoppala
2018-03-22 15:34 ` Jeff McGee
2018-03-22 17:01 ` Chris Wilson
2018-03-30 23:08 ` Chris Wilson
2018-03-31 8:59 ` Chris Wilson
2018-03-22 7:35 ` [PATCH 4/4] drm/i915: Flush pending interrupt following a GPU reset Chris Wilson
2018-03-22 7:43 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [1/4] drm/i915/selftests: Include the trace as a debug aide Patchwork
2018-03-22 7:49 ` [PATCH v2] " Chris Wilson
2018-03-22 14:26 ` Mika Kuoppala [this message]
2018-03-22 14:30 ` Chris Wilson
2018-03-22 19:29 ` Jeff McGee
2018-03-22 20:37 ` Chris Wilson
2018-03-22 7:58 ` ✓ Fi.CI.BAT: success for series starting with [1/4] " Patchwork
2018-03-22 8:02 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [v2] drm/i915/selftests: Include the trace as a debug aide (rev2) Patchwork
2018-03-22 8:19 ` ✓ Fi.CI.BAT: success " Patchwork
2018-03-22 10:23 ` ✓ Fi.CI.IGT: " Patchwork
-- strict thread matches above, loose matches on Subject: below --
2018-03-21 10:03 [PATCH] drm/i915/selftests: Include the trace as a debug aide Chris Wilson
2018-03-21 13:30 ` [PATCH v2] " Chris Wilson
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=87a7v05gpq.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.