diff options
author | Nirmoy Das <[email protected]> | 2024-06-03 10:17:23 +0200 |
---|---|---|
committer | Nirmoy Das <[email protected]> | 2024-06-05 09:52:13 +0200 |
commit | 8b01f970ee890574b3607c85781354a765c849bd (patch) | |
tree | 50dfa67a3b442ee077e4ace8dc0065cae6c25775 | |
parent | c393538e01a1b92a63899023857b8140100ca7f3 (diff) |
drm/xe: Use missing lock in relay_needs_worker
Add missing lock that is protecting relay->incoming_actions.
Cc: Michal Wajdeczko <[email protected]>
Reviewed-by: Michal Wajdeczko <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Signed-off-by: Nirmoy Das <[email protected]>
-rw-r--r-- | drivers/gpu/drm/xe/xe_guc_relay.c | 9 |
1 files changed, 8 insertions, 1 deletions
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) |