aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrián Larumbe <[email protected]>2024-05-23 12:32:18 +0100
committerBoris Brezillon <[email protected]>2024-05-29 09:30:39 +0200
commit8c2f5dd0c362ec036f0217da1d413ce2b8361080 (patch)
treec9e3fd54db7520d4b62630b344968b5267b1bd20
parente57f2187ccc125f1f14f6d2c83da80831fc3ce9a (diff)
drm/lima: Fix dma_resv deadlock at drm object pin time
Commit a78027847226 ("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 <[email protected]> Cc: Dmitry Osipenko <[email protected]> Cc: Boris Brezillon <[email protected]> Cc: Steven Price <[email protected]> Fixes: a78027847226 ("drm/gem: Acquire reservation lock in drm_gem_{pin/unpin}()") Signed-off-by: Adrián Larumbe <[email protected]> Reviewed-by: Boris Brezillon <[email protected]> Tested-by: Val Packett <[email protected]> Signed-off-by: Boris Brezillon <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
-rw-r--r--drivers/gpu/drm/lima/lima_gem.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/lima/lima_gem.c b/drivers/gpu/drm/lima/lima_gem.c
index 7ea244d876ca..9bb997dbb4b9 100644
--- a/drivers/gpu/drm/lima/lima_gem.c
+++ b/drivers/gpu/drm/lima/lima_gem.c
@@ -185,7 +185,7 @@ static int lima_gem_pin(struct drm_gem_object *obj)
if (bo->heap_size)
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)