diff mbox series

[v2] drm/msm/gem: Fix double resv lock aquire

Message ID 20240131011537.31049-1-robdclark@gmail.com (mailing list archive)
State New, archived
Headers show
Series [v2] drm/msm/gem: Fix double resv lock aquire | expand

Commit Message

Rob Clark Jan. 31, 2024, 1:15 a.m. UTC
From: Rob Clark <robdclark@chromium.org>

Since commit 56e5abba8c3e ("dma-buf: Add unlocked variant of vmapping
functions"), the resv lock is already held in the prime vmap path, so
don't try to grab it again.

v2: This applies to vunmap path as well

Fixes: 56e5abba8c3e ("dma-buf: Add unlocked variant of vmapping functions")
Signed-off-by: Rob Clark <robdclark@chromium.org>
---
 drivers/gpu/drm/msm/msm_gem_prime.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Dmitry Osipenko Jan. 31, 2024, 8:38 a.m. UTC | #1
On 1/31/24 04:15, Rob Clark wrote:
> From: Rob Clark <robdclark@chromium.org>
> 
> Since commit 56e5abba8c3e ("dma-buf: Add unlocked variant of vmapping
> functions"), the resv lock is already held in the prime vmap path, so
> don't try to grab it again.
> 
> v2: This applies to vunmap path as well
> 
> Fixes: 56e5abba8c3e ("dma-buf: Add unlocked variant of vmapping functions")
> Signed-off-by: Rob Clark <robdclark@chromium.org>

Nit: the offending commit should be 79e2cf2e7a19 ("drm/gem: Take
reservation lock for vmap/vunmap operations")

> ---
>  drivers/gpu/drm/msm/msm_gem_prime.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/msm/msm_gem_prime.c b/drivers/gpu/drm/msm/msm_gem_prime.c
> index 5f68e31a3e4e..0915f3b68752 100644
> --- a/drivers/gpu/drm/msm/msm_gem_prime.c
> +++ b/drivers/gpu/drm/msm/msm_gem_prime.c
> @@ -26,7 +26,7 @@ int msm_gem_prime_vmap(struct drm_gem_object *obj, struct iosys_map *map)
>  {
>  	void *vaddr;
>  
> -	vaddr = msm_gem_get_vaddr(obj);
> +	vaddr = msm_gem_get_vaddr_locked(obj);
>  	if (IS_ERR(vaddr))
>  		return PTR_ERR(vaddr);
>  	iosys_map_set_vaddr(map, vaddr);
> @@ -36,7 +36,7 @@ int msm_gem_prime_vmap(struct drm_gem_object *obj, struct iosys_map *map)
>  
>  void msm_gem_prime_vunmap(struct drm_gem_object *obj, struct iosys_map *map)
>  {
> -	msm_gem_put_vaddr(obj);
> +	msm_gem_put_vaddr_locked(obj);
>  }
>  
>  struct drm_gem_object *msm_gem_prime_import_sg_table(struct drm_device *dev,

Looks good otherwise
diff mbox series

Patch

diff --git a/drivers/gpu/drm/msm/msm_gem_prime.c b/drivers/gpu/drm/msm/msm_gem_prime.c
index 5f68e31a3e4e..0915f3b68752 100644
--- a/drivers/gpu/drm/msm/msm_gem_prime.c
+++ b/drivers/gpu/drm/msm/msm_gem_prime.c
@@ -26,7 +26,7 @@  int msm_gem_prime_vmap(struct drm_gem_object *obj, struct iosys_map *map)
 {
 	void *vaddr;
 
-	vaddr = msm_gem_get_vaddr(obj);
+	vaddr = msm_gem_get_vaddr_locked(obj);
 	if (IS_ERR(vaddr))
 		return PTR_ERR(vaddr);
 	iosys_map_set_vaddr(map, vaddr);
@@ -36,7 +36,7 @@  int msm_gem_prime_vmap(struct drm_gem_object *obj, struct iosys_map *map)
 
 void msm_gem_prime_vunmap(struct drm_gem_object *obj, struct iosys_map *map)
 {
-	msm_gem_put_vaddr(obj);
+	msm_gem_put_vaddr_locked(obj);
 }
 
 struct drm_gem_object *msm_gem_prime_import_sg_table(struct drm_device *dev,