Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/xe: Use missing lock in relay_needs_worker
@ 2024-06-03  8:17 Nirmoy Das
  2024-06-03  9:02 ` ✓ CI.Patch_applied: success for " Patchwork
                   ` (8 more replies)
  0 siblings, 9 replies; 12+ messages in thread
From: Nirmoy Das @ 2024-06-03  8:17 UTC (permalink / raw)
  To: intel-xe; +Cc: Nirmoy Das, Michal Wajdeczko

Add missing lock that is protecting relay->incoming_actions.

Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
Signed-off-by: Nirmoy Das <nirmoy.das@intel.com>
---
 drivers/gpu/drm/xe/xe_guc_relay.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/xe/xe_guc_relay.c b/drivers/gpu/drm/xe/xe_guc_relay.c
index c3bbaf474f9a..ade6162dc259 100644
--- a/drivers/gpu/drm/xe/xe_guc_relay.c
+++ b/drivers/gpu/drm/xe/xe_guc_relay.c
@@ -761,7 +761,14 @@ static void relay_process_incoming_action(struct xe_guc_relay *relay)
 
 static bool relay_needs_worker(struct xe_guc_relay *relay)
 {
-	return !list_empty(&relay->incoming_actions);
+	bool is_empty;
+
+	spin_lock(&relay->lock);
+	is_empty = list_empty(&relay->incoming_actions);
+	spin_unlock(&relay->lock);
+
+	return !is_empty;
+
 }
 
 static void relay_kick_worker(struct xe_guc_relay *relay)
-- 
2.42.0


^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2024-06-05  8:59 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-03  8:17 [PATCH] drm/xe: Use missing lock in relay_needs_worker Nirmoy Das
2024-06-03  9:02 ` ✓ CI.Patch_applied: success for " Patchwork
2024-06-03  9:02 ` ✓ CI.checkpatch: " Patchwork
2024-06-03  9:03 ` ✓ CI.KUnit: " Patchwork
2024-06-03  9:14 ` ✓ CI.Build: " Patchwork
2024-06-03  9:15 ` ✗ CI.Hooks: failure " Patchwork
2024-06-03  9:16 ` ✓ CI.checksparse: success " Patchwork
2024-06-03  9:56 ` ✓ CI.BAT: " Patchwork
2024-06-03 11:47 ` ✗ CI.FULL: failure " Patchwork
2024-06-05  8:58   ` Nirmoy Das
2024-06-03 14:19 ` [PATCH] " Michal Wajdeczko
2024-06-03 19:51   ` Nirmoy Das

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox