All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Thomas Hellström" <thomas.hellstrom@linux.intel.com>
To: intel-xe@lists.freedesktop.org
Subject: [Intel-xe] [PATCH 1/2] drm/xe: Make page-table updates using the default engine happen in order
Date: Thu, 29 Jun 2023 22:51:33 +0200	[thread overview]
Message-ID: <20230629205134.111849-2-thomas.hellstrom@linux.intel.com> (raw)
In-Reply-To: <20230629205134.111849-1-thomas.hellstrom@linux.intel.com>

If the default engine m->eng was used, there is no check for idle and
a cpu page-table update may thus happen in parallel with a gpu one.
Don't allow CPU page-table updates with the default engine until
the engine is idle.

Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
---
 drivers/gpu/drm/xe/xe_migrate.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/xe/xe_migrate.c b/drivers/gpu/drm/xe/xe_migrate.c
index 55e113dd7e82..41c90f6710ee 100644
--- a/drivers/gpu/drm/xe/xe_migrate.c
+++ b/drivers/gpu/drm/xe/xe_migrate.c
@@ -1160,9 +1160,10 @@ xe_migrate_update_pgtables(struct xe_migrate *m,
 	int err = 0;
 	bool usm = !eng && xe->info.supports_usm;
 	bool first_munmap_rebind = vma && vma->first_munmap_rebind;
+	struct xe_engine *eng_override = !eng ? m->eng : eng;
 
 	/* Use the CPU if no in syncs and engine is idle */
-	if (no_in_syncs(syncs, num_syncs) && (!eng || xe_engine_is_idle(eng))) {
+	if (no_in_syncs(syncs, num_syncs) && xe_engine_is_idle(eng_override)) {
 		fence =  xe_migrate_update_pgtables_cpu(m, vm, bo, updates,
 							num_updates,
 							first_munmap_rebind,
-- 
2.40.1


  reply	other threads:[~2023-06-29 20:51 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-29 20:51 [Intel-xe] [PATCH 0/2] drm/xe: Fix two bind races Thomas Hellström
2023-06-29 20:51 ` Thomas Hellström [this message]
2023-06-30  2:18   ` [Intel-xe] [PATCH 1/2] drm/xe: Make page-table updates using the default engine happen in order Matthew Brost
2023-06-29 20:51 ` [Intel-xe] [PATCH 2/2] drm/xe: Fix the separate bind-engine race using coarse-granularity dependencies Thomas Hellström
2023-07-01  4:21   ` Matthew Brost
2023-07-02 21:13     ` Thomas Hellström
2023-06-29 20:54 ` [Intel-xe] ✓ CI.Patch_applied: success for drm/xe: Fix two bind races Patchwork
2023-06-29 20:54 ` [Intel-xe] ✓ CI.checkpatch: " Patchwork
2023-06-29 20:56 ` [Intel-xe] ✓ CI.KUnit: " Patchwork
2023-06-29 20:59 ` [Intel-xe] ✓ CI.Build: " Patchwork
2023-06-29 21:00 ` [Intel-xe] ✓ CI.Hooks: " Patchwork
2023-06-29 21:01 ` [Intel-xe] ✗ CI.checksparse: warning " Patchwork
2023-06-29 21:45 ` [Intel-xe] ○ CI.BAT: info " 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=20230629205134.111849-2-thomas.hellstrom@linux.intel.com \
    --to=thomas.hellstrom@linux.intel.com \
    --cc=intel-xe@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.