From: Nirmoy Das Date: Mon, 3 Jun 2024 08:17:23 +0000 (+0200) Subject: drm/xe: Use missing lock in relay_needs_worker X-Git-Tag: v6.11-rc1~141^2~26^2~13 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8b01f970ee890574b3607c85781354a765c849bd;p=thirdparty%2Fkernel%2Fstable.git drm/xe: Use missing lock in relay_needs_worker Add missing lock that is protecting relay->incoming_actions. Cc: Michal Wajdeczko Reviewed-by: Michal Wajdeczko Link: https://patchwork.freedesktop.org/patch/msgid/20240603081723.18775-1-nirmoy.das@intel.com Signed-off-by: Nirmoy Das --- diff --git a/drivers/gpu/drm/xe/xe_guc_relay.c b/drivers/gpu/drm/xe/xe_guc_relay.c index c3bbaf474f9ad..ade6162dc2598 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)