Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/msm: always recover the gpu

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>

authored by

Anna Maniscalco and committed by
Rob Clark
01a0d6cd 6a0b843a

+20 -22
+20 -22
drivers/gpu/drm/msm/msm_gpu.c
··· 553 553 msm_update_fence(ring->fctx, fence); 554 554 } 555 555 556 - if (msm_gpu_active(gpu)) { 557 - /* retire completed submits, plus the one that hung: */ 558 - retire_submits(gpu); 556 + /* retire completed submits, plus the one that hung: */ 557 + retire_submits(gpu); 559 558 560 - gpu->funcs->recover(gpu); 559 + gpu->funcs->recover(gpu); 561 560 562 - /* 563 - * Replay all remaining submits starting with highest priority 564 - * ring 565 - */ 566 - for (i = 0; i < gpu->nr_rings; i++) { 567 - struct msm_ringbuffer *ring = gpu->rb[i]; 568 - unsigned long flags; 561 + /* 562 + * Replay all remaining submits starting with highest priority 563 + * ring 564 + */ 565 + for (i = 0; i < gpu->nr_rings; i++) { 566 + struct msm_ringbuffer *ring = gpu->rb[i]; 567 + unsigned long flags; 569 568 570 - spin_lock_irqsave(&ring->submit_lock, flags); 571 - list_for_each_entry(submit, &ring->submits, node) { 572 - /* 573 - * If the submit uses an unusable vm make sure 574 - * we don't actually run it 575 - */ 576 - if (to_msm_vm(submit->vm)->unusable) 577 - submit->nr_cmds = 0; 578 - gpu->funcs->submit(gpu, submit); 579 - } 580 - spin_unlock_irqrestore(&ring->submit_lock, flags); 569 + spin_lock_irqsave(&ring->submit_lock, flags); 570 + list_for_each_entry(submit, &ring->submits, node) { 571 + /* 572 + * If the submit uses an unusable vm make sure 573 + * we don't actually run it 574 + */ 575 + if (to_msm_vm(submit->vm)->unusable) 576 + submit->nr_cmds = 0; 577 + gpu->funcs->submit(gpu, submit); 581 578 } 579 + spin_unlock_irqrestore(&ring->submit_lock, flags); 582 580 } 583 581 584 582 pm_runtime_put(&gpu->pdev->dev);