Re: [Freedreno] [PATCH 09/14] drm/msm: Drop struct_mutex from the retire path

2020-10-05 Thread Jordan Crouse
On Sun, Oct 04, 2020 at 12:21:41PM -0700, Rob Clark wrote:
> From: Rob Clark 
> 
> Now that we are not relying on dev->struct_mutex to protect the
> ring->submits lists, drop the struct_mutex lock.

Reviewed-by: Jordan Crouse 
 
> Signed-off-by: Rob Clark 
> ---
>  drivers/gpu/drm/msm/msm_gpu.c | 8 +---
>  1 file changed, 1 insertion(+), 7 deletions(-)
> 
> diff --git a/drivers/gpu/drm/msm/msm_gpu.c b/drivers/gpu/drm/msm/msm_gpu.c
> index c9ff19a75169..5e351d1c00e9 100644
> --- a/drivers/gpu/drm/msm/msm_gpu.c
> +++ b/drivers/gpu/drm/msm/msm_gpu.c
> @@ -707,7 +707,7 @@ static void retire_submit(struct msm_gpu *gpu, struct 
> msm_ringbuffer *ring,
>  
>   msm_gem_active_put(_obj->base);
>   msm_gem_unpin_iova(_obj->base, submit->aspace);
> - drm_gem_object_put_locked(_obj->base);
> + drm_gem_object_put(_obj->base);
>   }
>  
>   pm_runtime_mark_last_busy(>pdev->dev);
> @@ -722,11 +722,8 @@ static void retire_submit(struct msm_gpu *gpu, struct 
> msm_ringbuffer *ring,
>  
>  static void retire_submits(struct msm_gpu *gpu)
>  {
> - struct drm_device *dev = gpu->dev;
>   int i;
>  
> - WARN_ON(!mutex_is_locked(>struct_mutex));
> -
>   /* Retire the commits starting with highest priority */
>   for (i = 0; i < gpu->nr_rings; i++) {
>   struct msm_ringbuffer *ring = gpu->rb[i];
> @@ -756,15 +753,12 @@ static void retire_submits(struct msm_gpu *gpu)
>  static void retire_worker(struct work_struct *work)
>  {
>   struct msm_gpu *gpu = container_of(work, struct msm_gpu, retire_work);
> - struct drm_device *dev = gpu->dev;
>   int i;
>  
>   for (i = 0; i < gpu->nr_rings; i++)
>   update_fences(gpu, gpu->rb[i], gpu->rb[i]->memptrs->fence);
>  
> - mutex_lock(>struct_mutex);
>   retire_submits(gpu);
> - mutex_unlock(>struct_mutex);
>  }
>  
>  /* call from irq handler to schedule work to retire bo's */
> -- 
> 2.26.2
> 
> ___
> Freedreno mailing list
> freedr...@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/freedreno

-- 
The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 09/14] drm/msm: Drop struct_mutex from the retire path

2020-10-04 Thread Rob Clark
From: Rob Clark 

Now that we are not relying on dev->struct_mutex to protect the
ring->submits lists, drop the struct_mutex lock.

Signed-off-by: Rob Clark 
---
 drivers/gpu/drm/msm/msm_gpu.c | 8 +---
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/msm/msm_gpu.c b/drivers/gpu/drm/msm/msm_gpu.c
index c9ff19a75169..5e351d1c00e9 100644
--- a/drivers/gpu/drm/msm/msm_gpu.c
+++ b/drivers/gpu/drm/msm/msm_gpu.c
@@ -707,7 +707,7 @@ static void retire_submit(struct msm_gpu *gpu, struct 
msm_ringbuffer *ring,
 
msm_gem_active_put(_obj->base);
msm_gem_unpin_iova(_obj->base, submit->aspace);
-   drm_gem_object_put_locked(_obj->base);
+   drm_gem_object_put(_obj->base);
}
 
pm_runtime_mark_last_busy(>pdev->dev);
@@ -722,11 +722,8 @@ static void retire_submit(struct msm_gpu *gpu, struct 
msm_ringbuffer *ring,
 
 static void retire_submits(struct msm_gpu *gpu)
 {
-   struct drm_device *dev = gpu->dev;
int i;
 
-   WARN_ON(!mutex_is_locked(>struct_mutex));
-
/* Retire the commits starting with highest priority */
for (i = 0; i < gpu->nr_rings; i++) {
struct msm_ringbuffer *ring = gpu->rb[i];
@@ -756,15 +753,12 @@ static void retire_submits(struct msm_gpu *gpu)
 static void retire_worker(struct work_struct *work)
 {
struct msm_gpu *gpu = container_of(work, struct msm_gpu, retire_work);
-   struct drm_device *dev = gpu->dev;
int i;
 
for (i = 0; i < gpu->nr_rings; i++)
update_fences(gpu, gpu->rb[i], gpu->rb[i]->memptrs->fence);
 
-   mutex_lock(>struct_mutex);
retire_submits(gpu);
-   mutex_unlock(>struct_mutex);
 }
 
 /* call from irq handler to schedule work to retire bo's */
-- 
2.26.2

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel