From: John.C.Harrison@Intel.com
To: Intel-GFX@Lists.FreeDesktop.Org
Cc: DRI-Devel@Lists.FreeDesktop.Org
Subject: [Intel-gfx] [PATCH 1/2] drm/i915/guc: Don't double enable a context
Date: Thu, 9 Nov 2023 16:54:08 -0800 [thread overview]
Message-ID: <20231110005409.304273-2-John.C.Harrison@Intel.com> (raw)
In-Reply-To: <20231110005409.304273-1-John.C.Harrison@Intel.com>
From: John Harrison <John.C.Harrison@Intel.com>
If a context is blocked, unblocked and subitted repeatedly in rapid
succession, the driver can end up trying to enable the context while
the previous enable request is still in flight. This can lead to much
confusion in the state tracking.
Prevent that by checking the pending enable flag before trying to
enable a context.
Signed-off-by: John Harrison <John.C.Harrison@Intel.com>
---
drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c b/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c
index d37698bd6b91a..d399e4d238c10 100644
--- a/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c
+++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c
@@ -720,7 +720,7 @@ static int __guc_add_request(struct intel_guc *guc, struct i915_request *rq)
if (unlikely(context_blocked(ce) && !intel_context_is_parent(ce)))
goto out;
- enabled = context_enabled(ce) || context_blocked(ce);
+ enabled = context_enabled(ce) || context_blocked(ce) || context_pending_enable(ce);
if (!enabled) {
action[len++] = INTEL_GUC_ACTION_SCHED_CONTEXT_MODE_SET;
--
2.41.0
next prev parent reply other threads:[~2023-11-10 0:53 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-10 0:54 [Intel-gfx] [PATCH 0/2] Don't send double context enable/disable requests John.C.Harrison
2023-11-10 0:54 ` John.C.Harrison [this message]
2023-11-15 21:18 ` [Intel-gfx] [PATCH 1/2] drm/i915/guc: Don't double enable a context Daniele Ceraolo Spurio
2023-11-10 0:54 ` [Intel-gfx] [PATCH 2/2] drm/i915/guc: Don't disable a context whose enable is still pending John.C.Harrison
2023-11-10 6:16 ` [Intel-gfx] ✗ Fi.CI.BAT: failure for Don't send double context enable/disable requests 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=20231110005409.304273-2-John.C.Harrison@Intel.com \
--to=john.c.harrison@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