Commit c5c1643c authored by Rob Clark's avatar Rob Clark

drm/msm: Drop struct_mutex from the retire path

Now that we are not relying on dev->struct_mutex to protect the
ring->submits lists, drop the struct_mutex lock.
Signed-off-by: default avatarRob Clark <robdclark@chromium.org>
Reviewed-by: default avatarJordan Crouse <jcrouse@codeaurora.org>
Reviewed-by: default avatarKristian H. Kristensen <hoegsberg@google.com>
Signed-off-by: default avatarRob Clark <robdclark@chromium.org>
parent fb1a1fcb
...@@ -713,7 +713,7 @@ static void retire_submit(struct msm_gpu *gpu, struct msm_ringbuffer *ring, ...@@ -713,7 +713,7 @@ static void retire_submit(struct msm_gpu *gpu, struct msm_ringbuffer *ring,
msm_gem_active_put(&msm_obj->base); msm_gem_active_put(&msm_obj->base);
msm_gem_unpin_iova(&msm_obj->base, submit->aspace); msm_gem_unpin_iova(&msm_obj->base, submit->aspace);
drm_gem_object_put_locked(&msm_obj->base); drm_gem_object_put(&msm_obj->base);
} }
pm_runtime_mark_last_busy(&gpu->pdev->dev); pm_runtime_mark_last_busy(&gpu->pdev->dev);
...@@ -728,11 +728,8 @@ static void retire_submit(struct msm_gpu *gpu, struct msm_ringbuffer *ring, ...@@ -728,11 +728,8 @@ static void retire_submit(struct msm_gpu *gpu, struct msm_ringbuffer *ring,
static void retire_submits(struct msm_gpu *gpu) static void retire_submits(struct msm_gpu *gpu)
{ {
struct drm_device *dev = gpu->dev;
int i; int i;
WARN_ON(!mutex_is_locked(&dev->struct_mutex));
/* Retire the commits starting with highest priority */ /* Retire the commits starting with highest priority */
for (i = 0; i < gpu->nr_rings; i++) { for (i = 0; i < gpu->nr_rings; i++) {
struct msm_ringbuffer *ring = gpu->rb[i]; struct msm_ringbuffer *ring = gpu->rb[i];
...@@ -762,15 +759,12 @@ static void retire_submits(struct msm_gpu *gpu) ...@@ -762,15 +759,12 @@ static void retire_submits(struct msm_gpu *gpu)
static void retire_worker(struct kthread_work *work) static void retire_worker(struct kthread_work *work)
{ {
struct msm_gpu *gpu = container_of(work, struct msm_gpu, retire_work); struct msm_gpu *gpu = container_of(work, struct msm_gpu, retire_work);
struct drm_device *dev = gpu->dev;
int i; int i;
for (i = 0; i < gpu->nr_rings; i++) for (i = 0; i < gpu->nr_rings; i++)
update_fences(gpu, gpu->rb[i], gpu->rb[i]->memptrs->fence); update_fences(gpu, gpu->rb[i], gpu->rb[i]->memptrs->fence);
mutex_lock(&dev->struct_mutex);
retire_submits(gpu); retire_submits(gpu);
mutex_unlock(&dev->struct_mutex);
} }
/* call from irq handler to schedule work to retire bo's */ /* call from irq handler to schedule work to retire bo's */
......
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