Commit 8c2f5dd0 authored by Adrián Larumbe's avatar Adrián Larumbe Committed by Boris Brezillon

drm/lima: Fix dma_resv deadlock at drm object pin time

Commit a7802784 ("drm/gem: Acquire reservation lock in
drm_gem_{pin/unpin}()") moved locking the DRM object's dma reservation to
drm_gem_pin(), but Lima's pin callback kept calling drm_gem_shmem_pin,
which also tries to lock the same dma_resv, leading to a double lock
situation.

As was already done for Panfrost in the previous commit, fix it by
replacing drm_gem_shmem_pin() with its locked variant.

Cc: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Cc: Boris Brezillon <boris.brezillon@collabora.com>
Cc: Steven Price <steven.price@arm.com>
Fixes: a7802784 ("drm/gem: Acquire reservation lock in drm_gem_{pin/unpin}()")
Signed-off-by: default avatarAdrián Larumbe <adrian.larumbe@collabora.com>
Reviewed-by: default avatarBoris Brezillon <boris.brezillon@collabora.com>
Tested-by: default avatarVal Packett <val@packett.cool>
Signed-off-by: default avatarBoris Brezillon <boris.brezillon@collabora.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240523113236.432585-3-adrian.larumbe@collabora.com
parent e57f2187
...@@ -185,7 +185,7 @@ static int lima_gem_pin(struct drm_gem_object *obj) ...@@ -185,7 +185,7 @@ static int lima_gem_pin(struct drm_gem_object *obj)
if (bo->heap_size) if (bo->heap_size)
return -EINVAL; return -EINVAL;
return drm_gem_shmem_pin(&bo->base); return drm_gem_shmem_pin_locked(&bo->base);
} }
static int lima_gem_vmap(struct drm_gem_object *obj, struct iosys_map *map) static int lima_gem_vmap(struct drm_gem_object *obj, struct iosys_map *map)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment