Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Lucas De Marchi <lucas.demarchi@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>,
	Matthew Brost <matthew.brost@intel.com>,
	Lucas De Marchi <lucas.demarchi@intel.com>
Subject: [PATCH i-g-t 3/3] lib/xe_spin: Fix ending the loop
Date: Tue, 30 Jul 2024 20:35:04 -0700	[thread overview]
Message-ID: <20240731033504.1426640-4-lucas.demarchi@intel.com> (raw)
In-Reply-To: <20240731033504.1426640-1-lucas.demarchi@intel.com>

Less likely to be a problem with optimizations than the started
condition, but let's stay on the safe side. Comparing to igt_spin_end(),
that one uses a sync_write() to force a MI_BATCH_BUFFER_END in the
beginning of the loop that has a even stronger guarantee.

Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
---
 lib/xe/xe_spin.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/xe/xe_spin.c b/lib/xe/xe_spin.c
index 43a7a43c2..f8b225125 100644
--- a/lib/xe/xe_spin.c
+++ b/lib/xe/xe_spin.c
@@ -183,7 +183,7 @@ void xe_spin_wait_started(struct xe_spin *spin)
 
 void xe_spin_end(struct xe_spin *spin)
 {
-	spin->end = 0;
+	WRITE_ONCE(spin->end, 0);
 }
 
 /**
-- 
2.43.0


  parent reply	other threads:[~2024-07-31  3:35 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-31  3:35 [PATCH i-g-t 0/3] fdinfo doc and xe_spin fix Lucas De Marchi
2024-07-31  3:35 ` [PATCH i-g-t 1/3] lib/igt_drm_fdinfo: Improve fdinfo parse documentation Lucas De Marchi
2024-07-31 21:19   ` Cavitt, Jonathan
2024-07-31  3:35 ` [PATCH i-g-t 2/3] lib/xe_spin: Fix xe_spin_wait_started() Lucas De Marchi
2024-07-31  6:06   ` Zbigniew Kempczyński
2024-08-01  5:42     ` Zbigniew Kempczyński
2024-08-08  6:00       ` Lucas De Marchi
2024-07-31 21:37   ` Cavitt, Jonathan
2024-07-31  3:35 ` Lucas De Marchi [this message]
2024-07-31  6:09   ` [PATCH i-g-t 3/3] lib/xe_spin: Fix ending the loop Zbigniew Kempczyński
2024-07-31 21:39   ` Cavitt, Jonathan
2024-07-31  4:38 ` ✓ CI.xeBAT: success for fdinfo doc and xe_spin fix Patchwork
2024-07-31  4:51 ` ✗ Fi.CI.BAT: failure " Patchwork
2024-07-31  5:44 ` ✗ CI.xeFULL: " 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=20240731033504.1426640-4-lucas.demarchi@intel.com \
    --to=lucas.demarchi@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=matthew.brost@intel.com \
    --cc=umesh.nerlige.ramappa@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