public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>,
	Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
	Intel graphics driver community testing & development
	<intel-gfx@lists.freedesktop.org>,
	Michal Wajdeczko <michal.wajdeczko@intel.com>,
	Arkadiusz Hiler <arkadiusz.hiler@intel.com>,
	Oscar Mateo <oscar.mateo@intel.com>,
	Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Subject: Re: [PATCH v2] drm/i915: Sanitize GuC client initialization
Date: Thu, 16 Feb 2017 08:22:38 -0800	[thread overview]
Message-ID: <1d6f5fd0-c91b-deae-06ab-9f7ba13ca35a@intel.com> (raw)
In-Reply-To: <20170216074422.GO18048@nuc-i3427.alporthouse.com>



On 15/02/17 23:44, Chris Wilson wrote:
> On Wed, Feb 15, 2017 at 06:28:59PM -0800, Daniele Ceraolo Spurio wrote:
>> On 14/02/17 05:53, Joonas Lahtinen wrote:
>>> -static void guc_disable_doorbell(struct intel_guc *guc,
>>> -				 struct i915_guc_client *client)
>>> +static int __destroy_doorbell(struct i915_guc_client *client)
>>> {
>>> -	(void)guc_update_doorbell_id(guc, client, GUC_INVALID_DOORBELL_ID);
>>> +	struct guc_doorbell_info *doorbell;
>>>
>>> -	/* XXX: wait for any interrupts */
>>> -	/* XXX: wait for workqueue to drain */
>>> +	doorbell = __get_doorbell(client);
>>> +	doorbell->db_status = GUC_DOORBELL_DISABLED;
>>> +	doorbell->cookie = 0;
>>> +
>>
>> Not from this patch (but since we're at it...), I did a bit of
>> digging and I've found that doorbell release flow requires SW to
>> poll the GEN8_DRBREGL(db_id) register after updating
>> doorbell->db_status to wait for the GEN8_DRB_VALID bit to go to
>> zero. This ensures that any pending events are processed before we
>> call into GuC to release the doorbell. Note that GuC will fail the
>> DEALLOCATE_DOORBELL action if the bit has not gone to zero yet. This
>> is currently not an issue, probably because we use a single doorbell
>> and we don't ring it near release time, but the situation could
>> change in the future so I believe it is worth to fix it now. I can
>> follow up with an additional patch if you want to keep this one as
>> refactoring only.
>
> Just keep in mind that we currently do a disable after GPU reset. The guc
> may not know what we are talking about :)
> -Chris
>

Yep, we should move the release to before reset or, if the 
client/doorbell page stays pinned across reset, limit ourselves to just 
updating the db status in memory (which will cause the validity bit to 
be updated accordingly) without notifying GuC, because as you said GuC 
will have no idea of what we're referring to.

I'm also seeing a doorbell release failure during driver unload:

[drm] INTEL_GUC_SEND: Action 0x20 failed; ret=-110 status=0x00000020 
response=0x00000000

I haven't looked int it yet (I was waiting for this patch to go in 
first), but when I reload the driver the status of the doorbells seems 
to be ok so probably just a communication issue with GuC.

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

  reply	other threads:[~2017-02-16 16:22 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-14 13:53 [PATCH v2] drm/i915: Sanitize GuC client initialization Joonas Lahtinen
2017-02-14 17:52 ` ✓ Fi.CI.BAT: success for drm/i915: Sanitize GuC client initialization (rev2) Patchwork
2017-02-16  2:28 ` [PATCH v2] drm/i915: Sanitize GuC client initialization Daniele Ceraolo Spurio
2017-02-16  7:44   ` Chris Wilson
2017-02-16 16:22     ` Daniele Ceraolo Spurio [this message]
2017-02-21 15:38   ` Joonas Lahtinen
2017-02-22 11:44     ` Joonas Lahtinen
2017-02-16 10:50 ` Oscar Mateo

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=1d6f5fd0-c91b-deae-06ab-9f7ba13ca35a@intel.com \
    --to=daniele.ceraolospurio@intel.com \
    --cc=arkadiusz.hiler@intel.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=joonas.lahtinen@linux.intel.com \
    --cc=michal.wajdeczko@intel.com \
    --cc=oscar.mateo@intel.com \
    --cc=tvrtko.ursulin@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox