Skip to contentSkip to conversation

drm/xe: Access port only after lock acquired

PATCH Superseded Tejas Upadhyay 1 participant 1 message Jun 4, 2024

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/xe: Access port only after lock acquired

Currently, port is accessed before lock of port is acquired. As followed at other places, lets acquire lock before accessing for even better sync up.

---
 drivers/gpu/drm/xe/xe_execlist.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/gpu/drm/xe/xe_execlist.c +3 -2
index db906117db6d..61dc08318ceb 100644
@@ -210,15 +210,16 @@ static void xe_execlist_port_wake_locked(struct xe_execlist_port *port,
 
 static void xe_execlist_make_active(struct xe_execlist_exec_queue *exl)
 {
-	struct xe_execlist_port *port = exl->port;
+	struct xe_execlist_port *port;
 	enum xe_exec_queue_priority priority = exl->q->sched_props.priority;
 
 	XE_WARN_ON(priority == XE_EXEC_QUEUE_PRIORITY_UNSET);
 	XE_WARN_ON(priority < 0);
 	XE_WARN_ON(priority >= ARRAY_SIZE(exl->port->active));
 
-	spin_lock_irq(&port->lock);
+	spin_lock_irq(&exl->port->lock);
 
+	port = exl->port;
 	if (exl->active_priority != priority &&
 	    exl->active_priority != XE_EXEC_QUEUE_PRIORITY_UNSET) {
 		/* Priority changed, move it to the right list */
Signature · 1 line
2.25.1