All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Alexandru Dadu" <alexandru.dadu@imgtec.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v7 3/3] drm/imagination: Release pm references in case of error
Date: Thu, 24 Sep 2026 07:38:29 +0000	[thread overview]
Message-ID: <20260924073830.26A771F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260924-b4-upstream-propagate-all-errors-from-kccb-cmd-submission-code-v7-3-584796cb599d@imgtec.com>

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 <alexandru.dadu@imgtec.com>
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-584796cb599d@imgtec.com?part=3

      reply	other threads:[~2026-09-24  7:38 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-24  7:29 [PATCH v7 0/3] drm/imagination: Propagate all KCCB command submission code errors Alexandru Dadu
2026-09-24  7:29 ` [PATCH v7 1/3] drm/imagination: Release KCCB slot on error path in pvr_queue_run_job() Alexandru Dadu
2026-09-24  7:29 ` [PATCH v7 2/3] drm/imagination: Propagate all errors from KCCB command submission code Alexandru Dadu
2026-09-24  7:43   ` sashiko-bot
2026-09-24  7:29 ` [PATCH v7 3/3] drm/imagination: Release pm references in case of error Alexandru Dadu
2026-09-24  7:38   ` sashiko-bot [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260924073830.26A771F000FF@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=alexandru.dadu@imgtec.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.