From: "Teres Alexis, Alan Previn" <alan.previn.teres.alexis@intel.com>
To: "intel-gfx@lists.freedesktop.org" <intel-gfx@lists.freedesktop.org>
Cc: "dri-devel@lists.freedesktop.org" <dri-devel@lists.freedesktop.org>
Subject: Re: [Intel-gfx] [PATCH v1 2/3] drm/i915/guc: Close deregister-context race against CT-loss
Date: Thu, 10 Aug 2023 03:39:10 +0000 [thread overview]
Message-ID: <b258982b068114bb7e333bcd15349c30c956545c.camel@intel.com> (raw)
In-Reply-To: <20230802233501.17074-3-alan.previn.teres.alexis@intel.com>
On Wed, 2023-08-02 at 16:35 -0700, Teres Alexis, Alan Previn wrote:
> If we are at the end of suspend or very early in resume
> its possible an async fence signal could lead us to the
> execution of the context destruction worker (after the
> prior worker flush).
>
alan:snip
>
> static void __guc_context_destroy(struct intel_context *ce)
> @@ -3270,7 +3287,20 @@ static void deregister_destroyed_contexts(struct intel_guc *guc)
> if (!ce)
> break;
>
> - guc_lrc_desc_unpin(ce);
> + if (guc_lrc_desc_unpin(ce)) {
> + /*
> + * This means GuC's CT link severed mid-way which only happens
> + * in suspend-resume corner cases. In this case, put the
> + * context back into the destroyed_contexts list which will
> + * get picked up on the next context deregistration event or
> + * purged in a GuC sanitization event (reset/unload/wedged/...).
> + */
> + spin_lock_irqsave(&guc->submission_state.lock, flags);
> + list_add_tail(&ce->destroyed_link,
> + &guc->submission_state.destroyed_contexts);
alan: i completely missed the fact this new code is sitting within a
while (!list_empty(&guc->submission_state.submission_state.destroyed_contexts) block
so putting it back will cause it to while loop forever.
will fix and rerev.
> + spin_unlock_irqrestore(&guc->submission_state.lock, flags);
> + }
> +
> }
> }
>
next prev parent reply other threads:[~2023-08-10 3:39 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-02 23:34 [Intel-gfx] [PATCH v1 0/3] Resolve suspend-resume racing with GuC destroy-context-worker Alan Previn
2023-08-02 23:34 ` [Intel-gfx] [PATCH v1 1/3] drm/i915/guc: Flush context destruction worker at suspend Alan Previn
2023-08-07 17:52 ` Rodrigo Vivi
2023-08-09 21:09 ` Teres Alexis, Alan Previn
2023-08-15 0:49 ` Teres Alexis, Alan Previn
2023-08-02 23:35 ` [Intel-gfx] [PATCH v1 2/3] drm/i915/guc: Close deregister-context race against CT-loss Alan Previn
2023-08-10 3:39 ` Teres Alexis, Alan Previn [this message]
2023-08-02 23:35 ` [Intel-gfx] [PATCH v1 3/3] drm/i915/gt: Timeout when waiting for idle in suspending Alan Previn
2023-08-07 17:56 ` Rodrigo Vivi
2023-08-09 19:38 ` Teres Alexis, Alan Previn
2023-08-02 23:52 ` [Intel-gfx] [PATCH v1 0/3] Resolve suspend-resume racing with GuC destroy-context-worker Teres Alexis, Alan Previn
2023-08-03 0:10 ` [Intel-gfx] ✗ Fi.CI.SPARSE: warning for " Patchwork
2023-08-03 0:24 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2023-08-03 5:41 ` [Intel-gfx] ✓ 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=b258982b068114bb7e333bcd15349c30c956545c.camel@intel.com \
--to=alan.previn.teres.alexis@intel.com \
--cc=dri-devel@lists.freedesktop.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox