drm/xe: Use missing lock in relay_needs_worker
[ Upstream commit 8b01f970ee ]
Add missing lock that is protecting relay->incoming_actions.
Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
Reviewed-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240603081723.18775-1-nirmoy.das@intel.com
Signed-off-by: Nirmoy Das <nirmoy.das@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
99331fe68a
commit
4ff3d3d18d
@@ -757,7 +757,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)
|
||||
|
||||
Reference in New Issue
Block a user