Skip to content

Commit 132b8d5

Browse files
Anna Maniscalcogregkh
authored andcommitted
drm/msm: always recover the gpu
commit 01a0d6c upstream. Previously, in case there was no more work to do, recover worker wouldn't trigger recovery and would instead rely on the gpu going to sleep and then resuming when more work is submitted. Recover_worker will first increment the fence of the hung ring so, if there's only one job submitted to a ring and that causes an hang, it will early out. There's no guarantee that the gpu will suspend and resume before more work is submitted and if the gpu is in a hung state it will stay in that state and probably trigger a timeout again. Just stop checking and always recover the gpu. Signed-off-by: Anna Maniscalco <anna.maniscalco2000@gmail.com> Cc: stable@vger.kernel.org Patchwork: https://patchwork.freedesktop.org/patch/704066/ Message-ID: <20260210-recovery_suspend_fix-v1-1-00ed9013da04@gmail.com> Signed-off-by: Rob Clark <robin.clark@oss.qualcomm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent c5b5a0e commit 132b8d5

1 file changed

Lines changed: 20 additions & 22 deletions

File tree

drivers/gpu/drm/msm/msm_gpu.c

Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -548,32 +548,30 @@ static void recover_worker(struct kthread_work *work)
548548
msm_update_fence(ring->fctx, fence);
549549
}
550550

551-
if (msm_gpu_active(gpu)) {
552-
/* retire completed submits, plus the one that hung: */
553-
retire_submits(gpu);
551+
/* retire completed submits, plus the one that hung: */
552+
retire_submits(gpu);
554553

555-
gpu->funcs->recover(gpu);
554+
gpu->funcs->recover(gpu);
556555

557-
/*
558-
* Replay all remaining submits starting with highest priority
559-
* ring
560-
*/
561-
for (i = 0; i < gpu->nr_rings; i++) {
562-
struct msm_ringbuffer *ring = gpu->rb[i];
563-
unsigned long flags;
556+
/*
557+
* Replay all remaining submits starting with highest priority
558+
* ring
559+
*/
560+
for (i = 0; i < gpu->nr_rings; i++) {
561+
struct msm_ringbuffer *ring = gpu->rb[i];
562+
unsigned long flags;
564563

565-
spin_lock_irqsave(&ring->submit_lock, flags);
566-
list_for_each_entry(submit, &ring->submits, node) {
567-
/*
568-
* If the submit uses an unusable vm make sure
569-
* we don't actually run it
570-
*/
571-
if (to_msm_vm(submit->vm)->unusable)
572-
submit->nr_cmds = 0;
573-
gpu->funcs->submit(gpu, submit);
574-
}
575-
spin_unlock_irqrestore(&ring->submit_lock, flags);
564+
spin_lock_irqsave(&ring->submit_lock, flags);
565+
list_for_each_entry(submit, &ring->submits, node) {
566+
/*
567+
* If the submit uses an unusable vm make sure
568+
* we don't actually run it
569+
*/
570+
if (to_msm_vm(submit->vm)->unusable)
571+
submit->nr_cmds = 0;
572+
gpu->funcs->submit(gpu, submit);
576573
}
574+
spin_unlock_irqrestore(&ring->submit_lock, flags);
577575
}
578576

579577
pm_runtime_put(&gpu->pdev->dev);

0 commit comments

Comments
 (0)