Skip to content

Commit 917e9b7

Browse files
committed
Revert "drm/msm/gpu: Push gpu lock down past runpm"
This reverts commit abe2023. Changing the locking order means that scheduler/msm_job_run() can race with the recovery kthread worker, with the result that the GPU gets an extra runpm get when we are trying to power it off. Leaving the GPU in an unrecovered state. I'll need to come up with a different scheme for appeasing lockdep. Signed-off-by: Rob Clark <robdclark@chromium.org> Patchwork: https://patchwork.freedesktop.org/patch/573835/
1 parent 6a0dbcd commit 917e9b7

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

drivers/gpu/drm/msm/msm_gpu.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -751,12 +751,14 @@ void msm_gpu_submit(struct msm_gpu *gpu, struct msm_gem_submit *submit)
751751
struct msm_ringbuffer *ring = submit->ring;
752752
unsigned long flags;
753753

754-
pm_runtime_get_sync(&gpu->pdev->dev);
754+
WARN_ON(!mutex_is_locked(&gpu->lock));
755755

756-
mutex_lock(&gpu->lock);
756+
pm_runtime_get_sync(&gpu->pdev->dev);
757757

758758
msm_gpu_hw_init(gpu);
759759

760+
submit->seqno = submit->hw_fence->seqno;
761+
760762
update_sw_cntrs(gpu);
761763

762764
/*
@@ -781,11 +783,8 @@ void msm_gpu_submit(struct msm_gpu *gpu, struct msm_gem_submit *submit)
781783
gpu->funcs->submit(gpu, submit);
782784
gpu->cur_ctx_seqno = submit->queue->ctx->seqno;
783785

784-
hangcheck_timer_reset(gpu);
785-
786-
mutex_unlock(&gpu->lock);
787-
788786
pm_runtime_put(&gpu->pdev->dev);
787+
hangcheck_timer_reset(gpu);
789788
}
790789

791790
/*

drivers/gpu/drm/msm/msm_ringbuffer.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ static struct dma_fence *msm_job_run(struct drm_sched_job *job)
2121

2222
msm_fence_init(submit->hw_fence, fctx);
2323

24-
submit->seqno = submit->hw_fence->seqno;
25-
2624
mutex_lock(&priv->lru.lock);
2725

2826
for (i = 0; i < submit->nr_bos; i++) {
@@ -35,8 +33,13 @@ static struct dma_fence *msm_job_run(struct drm_sched_job *job)
3533

3634
mutex_unlock(&priv->lru.lock);
3735

36+
/* TODO move submit path over to using a per-ring lock.. */
37+
mutex_lock(&gpu->lock);
38+
3839
msm_gpu_submit(gpu, submit);
3940

41+
mutex_unlock(&gpu->lock);
42+
4043
return dma_fence_get(submit->hw_fence);
4144
}
4245

0 commit comments

Comments
 (0)