drm/xe/client: remove bogus rcu list usage
authorMatthew Auld <matthew.auld@intel.com>
Mon, 18 Mar 2024 09:34:32 +0000 (09:34 +0000)
committerMatthew Auld <matthew.auld@intel.com>
Tue, 19 Mar 2024 08:31:41 +0000 (08:31 +0000)
We use plain spinlock to protect readers and writers, so there is no
actual RCU here. Rather use the more appropriate non-rcu list based API.

Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Cc: Nirmoy Das <nirmoy.das@intel.com>
Reviewed-by: Nirmoy Das <nirmoy.das@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240318093431.21075-3-matthew.auld@intel.com
drivers/gpu/drm/xe/xe_drm_client.c

index 6040e4d22b2809c10385fadfbd6f4d8b6fdd0b28..142a1905b624eb73fc93faf33f44f02790d1132c 100644 (file)
@@ -78,7 +78,7 @@ void xe_drm_client_add_bo(struct xe_drm_client *client,
 
        spin_lock(&client->bos_lock);
        bo->client = xe_drm_client_get(client);
-       list_add_tail_rcu(&bo->client_link, &client->bos_list);
+       list_add_tail(&bo->client_link, &client->bos_list);
        spin_unlock(&client->bos_lock);
 }
 
@@ -96,7 +96,7 @@ void xe_drm_client_remove_bo(struct xe_bo *bo)
        struct xe_drm_client *client = bo->client;
 
        spin_lock(&client->bos_lock);
-       list_del_rcu(&bo->client_link);
+       list_del(&bo->client_link);
        spin_unlock(&client->bos_lock);
 
        xe_drm_client_put(client);
@@ -154,7 +154,7 @@ static void show_meminfo(struct drm_printer *p, struct drm_file *file)
 
        /* Internal objects. */
        spin_lock(&client->bos_lock);
-       list_for_each_entry_rcu(bo, &client->bos_list, client_link) {
+       list_for_each_entry(bo, &client->bos_list, client_link) {
                if (!bo || !kref_get_unless_zero(&bo->ttm.base.refcount))
                        continue;
                bo_meminfo(bo, stats);