From: sashiko-bot@kernel.org
To: "Alexandru Dadu" <alexandru.dadu@imgtec.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v6 3/3] drm/imagination: Release pm references in case of error
Date: Thu, 24 Sep 2026 06:29:09 +0000 [thread overview]
Message-ID: <20260924062910.4DDCB1F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260924-b4-upstream-propagate-all-errors-from-kccb-cmd-submission-code-v6-3-d9d5375665ed@imgtec.com>
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [High] drm/pvr: misplaced pm_ref get clobbers submission error
- [Medium] drm/pvr: misapplied PM reference error handling is dead code
--
commit 5439537ea7866cb6e72eceafcbe08fbac4918034
Author: Alexandru Dadu <alexandru.dadu@imgtec.com>
drm/imagination: Release pm references in case of error
This commit attempts to add early release of power references in case of
errors during job submission.
> diff --git a/drivers/gpu/drm/imagination/pvr_queue.c b/drivers/gpu/drm/imagination/pvr_queue.c
> index b58c0887cafe5..1b013791897dd 100644
> --- a/drivers/gpu/drm/imagination/pvr_queue.c
> +++ b/drivers/gpu/drm/imagination/pvr_queue.c
[ ... ]
> @@ -817,9 +817,19 @@ static struct dma_fence *pvr_queue_run_job(struct drm_sched_job *sched_job)
> trace_pvr_job_submit_fw(job);
> }
>
> + err = pvr_job_get_pm_ref(job);
> +
[Severity: High]
Does this assignment overwrite the err variable containing the result of the
KCCB kick?
If pvr_cccb_send_kccb_kick() or pvr_cccb_send_kccb_combined_kick() returned
an error, pvr_job_get_pm_ref() will return 0 since the reference was already
acquired at the start of pvr_queue_run_job(). This causes the hardware
submission error to be lost, and the scheduler will receive a success
indication instead of an error.
> 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]
Is this error handling logic unreachable?
Because the PM reference for job->paired_job was already acquired at the
beginning of the function, pvr_job_get_pm_ref() will return 0, making the
WARN_ON(err) condition unreachable.
If this abort path were somehow reached after the job was successfully
submitted to the hardware, jumping to err_release would inappropriately call
pvr_kccb_release_slot(). Could this corrupt KCCB slot accounting since the
hardware kick already occurred?
> + }
> + }
> +
> return dma_fence_get(job->done_fence);
>
> err_release:
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260924-b4-upstream-propagate-all-errors-from-kccb-cmd-submission-code-v6-0-d9d5375665ed@imgtec.com?part=3
prev parent reply other threads:[~2026-09-24 6:29 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-24 6:19 [PATCH v6 0/3] drm/imagination: Propagate all KCCB command submission code errors Alexandru Dadu
2026-09-24 6:19 ` [PATCH v6 1/3] drm/imagination: Release KCCB slot on error path in pvr_queue_run_job() Alexandru Dadu
2026-09-24 6:19 ` [PATCH v6 2/3] drm/imagination: Propagate all errors from KCCB command submission code Alexandru Dadu
2026-09-24 6:31 ` sashiko-bot
2026-09-24 6:19 ` [PATCH v6 3/3] drm/imagination: Release pm references in case of error Alexandru Dadu
2026-09-24 6:29 ` 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=20260924062910.4DDCB1F000FF@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.