summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/xe/xe_drm_client.c
diff options
context:
space:
mode:
authorMatthew Brost <matthew.brost@intel.com>2024-09-20 18:17:12 -0700
committerMatthew Brost <matthew.brost@intel.com>2024-09-24 09:03:42 -0700
commitfe4f5d4b661666a45b48fe7f95443f8fefc09c8c (patch)
tree31e40d590d3f9fcce8d8f0b9ab4930b04e9bc382 /drivers/gpu/drm/xe/xe_drm_client.c
parent876253165f3eaaacacb8c8bed16a9df4b6081479 (diff)
downloadlinux-next-fe4f5d4b661666a45b48fe7f95443f8fefc09c8c.tar.gz
linux-next-fe4f5d4b661666a45b48fe7f95443f8fefc09c8c.zip
drm/xe: Clean up VM / exec queue file lock usage.
Both the VM / exec queue file lock protect the lookup and reference to the object, nothing more. These locks are not intended anything else underneath them. XA have their own locking too, so no need to take the VM / exec queue file lock aside from when doing a lookup and reference get. Add some kernel doc to make this clear and cleanup a few typos too. Signed-off-by: Matthew Brost <matthew.brost@intel.com> Reviewed-by: Matthew Auld <matthew.auld@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240921011712.2681510-1-matthew.brost@intel.com
Diffstat (limited to 'drivers/gpu/drm/xe/xe_drm_client.c')
-rw-r--r--drivers/gpu/drm/xe/xe_drm_client.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/gpu/drm/xe/xe_drm_client.c b/drivers/gpu/drm/xe/xe_drm_client.c
index c4add8b38bbd..fb52a23e28f8 100644
--- a/drivers/gpu/drm/xe/xe_drm_client.c
+++ b/drivers/gpu/drm/xe/xe_drm_client.c
@@ -283,8 +283,15 @@ static void show_run_ticks(struct drm_printer *p, struct drm_file *file)
/* Accumulate all the exec queues from this client */
mutex_lock(&xef->exec_queue.lock);
- xa_for_each(&xef->exec_queue.xa, i, q)
+ xa_for_each(&xef->exec_queue.xa, i, q) {
+ xe_exec_queue_get(q);
+ mutex_unlock(&xef->exec_queue.lock);
+
xe_exec_queue_update_run_ticks(q);
+
+ mutex_lock(&xef->exec_queue.lock);
+ xe_exec_queue_put(q);
+ }
mutex_unlock(&xef->exec_queue.lock);
/* Get the total GPU cycles */