All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>,
	"Srivatsa, Anusha" <anusha.srivatsa@intel.com>,
	"intel-gfx@lists.freedesktop.org"
	<intel-gfx@lists.freedesktop.org>
Subject: Re: [RFC] drm/i915/guc: capture GuC logs if FW fails to load
Date: Fri, 5 May 2017 08:43:36 -0700	[thread overview]
Message-ID: <f2a9fab9-f651-56bb-edc1-8797f9ab9969@intel.com> (raw)
In-Reply-To: <20170504213135.GT24019@nuc-i3427.alporthouse.com>



On 04/05/17 14:31, Chris Wilson wrote:
> On Thu, May 04, 2017 at 09:26:35PM +0000, Srivatsa, Anusha wrote:
>>> +void i915_guc_load_error_log_capture(struct drm_i915_private *i915) {
>>> +	void *log, *buf;
>>> +	struct i915_vma *vma = i915->guc.log.vma;
>>> +
>>> +	if (i915->gpu_error.guc_load_fail_log || !vma)
>>> +		return;
>>> +
>>> +	/*
>>> +	 * the vma should be already pinned and mapped for log runtime
>>> +	 * management but let's play safe
>>> +	 */
>>> +	log = i915_gem_object_pin_map(vma->obj, I915_MAP_WC);
>>> +	if (IS_ERR(log)) {
>>> +		DRM_ERROR("Failed to pin guc_log vma\n");
>>> +		return;
>>> +	}
>>> +
>>> +	buf = kzalloc(GUC_LOG_SIZE, GFP_KERNEL);
>>> +	if (buf) {
>>> +		memcpy(buf, log, GUC_LOG_SIZE);
>>> +		i915->gpu_error.guc_load_fail_log = buf;
>>> +	} else {
>>> +		DRM_ERROR("Failed to copy guc log\n");
>>> +	}
>>> +
>>> +	i915_gem_object_unpin_map(vma->obj);
>
> You are trading a swappable object for unswappable kernel memory. If you
> want to have the guc log after guc is disabled, just keep the log object
> around.
> -Chris
>

I had considered that, but in the end I wasn't sure if that was 
acceptable in case we end up modifying the code to recycle the object 
for future load attempts, although that is very unlikely. I was however 
unconvinced myself of using kzalloc and that's mainly why this was an RFC :)
I'll flip it to take an extra reference on the object.

Thanks,
Daniele
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2017-05-05 15:43 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-04 18:51 [RFC] drm/i915/guc: capture GuC logs if FW fails to load Daniele Ceraolo Spurio
2017-05-04 19:20 ` ✓ Fi.CI.BAT: success for " Patchwork
2017-05-04 21:26 ` [RFC] " Srivatsa, Anusha
2017-05-04 21:31   ` Chris Wilson
2017-05-05 15:43     ` Daniele Ceraolo Spurio [this message]
2017-05-05 15:55       ` Chris Wilson
2017-05-05 15:40   ` Daniele Ceraolo Spurio

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=f2a9fab9-f651-56bb-edc1-8797f9ab9969@intel.com \
    --to=daniele.ceraolospurio@intel.com \
    --cc=anusha.srivatsa@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.