dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Ketil Johnsen" <ketil.johnsen@arm.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v4 02/12] drm/panthor: Minor scheduler refactoring
Date: Mon, 12 Oct 2026 13:05:33 +0000	[thread overview]
Message-ID: <sashiko-outbox-168138@kernel.org> (raw)
In-Reply-To: <20261012125940.3291951-3-ketil.johnsen@arm.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] Unassigned return value from csg_slot_prog_locked() causes dead error path
--

commit 7eff0da835de3ef4c810c3a0eb36aa6ce221f295
Author: Florent Tomasin <florent.tomasin@arm.com>

drm/panthor: Minor scheduler refactoring

This commit refactors parts of the group scheduling logic into new helper
functions. This change simplifies the addition of the protected mode feature
and removes redundant assignments of csg_slot.

> diff --git a/drivers/gpu/drm/panthor/panthor_sched.c b/drivers/gpu/drm/panthor/panthor_sched.c
> index 0493858e55d76..68425fe561d1a 100644
> --- a/drivers/gpu/drm/panthor/panthor_sched.c
> +++ b/drivers/gpu/drm/panthor/panthor_sched.c
> @@ -2345,12 +2345,85 @@ tick_ctx_cleanup(struct panthor_scheduler *sched,
[ ... ]
> +static int
> +tick_ctx_schedule_group(struct panthor_scheduler *sched,
> +			struct panthor_csg_slots_upd_ctx *upd_ctx,
> +			struct panthor_group *group,
> +			int csg_id, int csg_prio)
> +{
> +	struct panthor_device *ptdev = sched->ptdev;
> +	struct panthor_fw_csg_iface *csg_iface =
> +		panthor_fw_get_csg_iface(ptdev, csg_id);
> +	int ret;
> +
> +	ret = group_bind_locked(group, csg_id);
> +	if (ret)
> +		return ret;
> +
> +	csg_slot_prog_locked(ptdev, csg_id, csg_prio);
> +	if (ret) {
> +		group_unbind_locked(group);
> +		return ret;
> +	}

[Severity: Medium]
Is the return value from csg_slot_prog_locked() intentionally ignored here?

Because `ret` was successfully checked after group_bind_locked(), it is
guaranteed to be 0 at this point. As a result, the `if (ret)` check will
always evaluate to false, making the error handling block dead code.

If csg_slot_prog_locked() fails, the failure is silently ignored and the
function proceeds to queue CSG_STATE_START hardware requests for a slot that
hasn't been successfully programmed, which can lead to hardware timeouts or
undefined behavior.

Should this be `ret = csg_slot_prog_locked(ptdev, csg_id, csg_prio);` instead,
matching the patch's stated intention in the v4 changelog to handle the error
from this function?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261012125940.3291951-1-ketil.johnsen@arm.com?part=2

  reply	other threads:[~2026-10-12 13:05 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-12 12:59 [PATCH v4 00/12] drm/panthor: Protected mode support for Mali CSF GPUs Ketil Johnsen
2026-10-12 12:59 ` [PATCH v4 01/12] drm/panthor: De-duplicate FW memory section sync Ketil Johnsen
2026-10-12 12:59 ` [PATCH v4 02/12] drm/panthor: Minor scheduler refactoring Ketil Johnsen
2026-10-12 13:05   ` sashiko-bot [this message]
2026-10-12 12:59 ` [PATCH v4 03/12] drm/panthor: Pass drm_file instead of panthor_file Ketil Johnsen
2026-10-12 12:59 ` [PATCH v4 04/12] drm/panthor: Don't allocate protm_suspend_buf Ketil Johnsen
2026-10-12 12:59 ` [PATCH v4 05/12] drm/panthor: Add support for entering and exiting protected mode Ketil Johnsen
2026-10-12 13:17   ` sashiko-bot
2026-10-12 12:59 ` [PATCH v4 06/12] drm/panthor: New function for FW section map flags Ketil Johnsen
2026-10-12 12:59 ` [PATCH v4 07/12] drm/panthor: Keep size and VA in FW section obj Ketil Johnsen
2026-10-12 12:59 ` [PATCH v4 08/12] drm/panthor: Refactor GEM usage flags assignment Ketil Johnsen
2026-10-12 12:59 ` [PATCH v4 09/12] drm/panthor: Create kernel BO from existing GEM Ketil Johnsen
2026-10-12 13:12   ` sashiko-bot
2026-10-12 12:59 ` [PATCH v4 10/12] drm/panthor: Support FW init of protm Ketil Johnsen
2026-10-12 13:15   ` sashiko-bot
2026-10-12 12:59 ` [PATCH v4 11/12] drm/panthor: Protm support for groups Ketil Johnsen
2026-10-12 13:15   ` sashiko-bot
2026-10-12 12:59 ` [PATCH v4 12/12] drm/panthor: Bump version to expose protm feature Ketil Johnsen

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=sashiko-outbox-168138@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=ketil.johnsen@arm.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox