Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [Medium] drm/imagination: misplaced code adds dead block and fails to fix PM leaks --
commit ee55e37dd6c9d6ec50a0931a6efbed821fcc945d Author: Alexandru Dadu <[email protected]> drm/imagination: Release pm references in case of error This commit attempts to fix power management reference leaks by adding early releases on error. > diff --git a/drivers/gpu/drm/imagination/pvr_queue.c > b/drivers/gpu/drm/imagination/pvr_queue.c > index b58c0887cafe5..c72f1d0b8bc00 100644 > --- a/drivers/gpu/drm/imagination/pvr_queue.c > +++ b/drivers/gpu/drm/imagination/pvr_queue.c > @@ -820,6 +820,19 @@ static struct dma_fence *pvr_queue_run_job(struct > drm_sched_job *sched_job) > if (WARN_ON(err)) > goto err_release; > > + err = pvr_job_get_pm_ref(job); > + > + if (WARN_ON(err)) > + goto err_release; > + > + if (job->paired_job) { > + err = pvr_job_get_pm_ref(job->paired_job); > + if (WARN_ON(err)) { > + pvr_job_release_pm_ref(job); > + goto err_release; > + } > + } > + [Severity: Medium] Does this block act as dead code instead of fixing the error paths? This code is placed in the success path of pvr_queue_run_job() where the PM references are already successfully held from earlier in the function. Because job->has_pm_ref is already true when execution reaches here, pvr_job_get_pm_ref() simply returns 0 and does nothing. > return dma_fence_get(job->done_fence); > > err_release: > pvr_kccb_release_slot(pvr_dev); > return ERR_PTR(err); > } [Severity: Medium] Does the targeted PM leak remain unfixed in this error path? When an internal job submission fails (for example, if pvr_cccb_send_kccb_kick() fails) and execution jumps to err_release, the PM references acquired earlier in the function are not released, which would leak the references and prevent the GPU from entering runtime suspend. -- Sashiko AI review ยท https://sashiko.dev/#/patchset/20260924-b4-upstream-propagate-all-errors-from-kccb-cmd-submission-code-v7-0-584796cb5...@imgtec.com?part=3
