All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Boris Brezillon" <boris.brezillon@collabora.com>
Cc: dri-devel@lists.freedesktop.org, media-ci@linuxtv.org
Subject: Re: [PATCH v4 2/3] drm/sched: Add a drm_sched_job_add_dependency_unwrapped() helper
Date: Wed, 02 Dec 2026 11:44:37 +0000	[thread overview]
Message-ID: <sashiko-outbox-245629@kernel.org> (raw)
In-Reply-To: <20261202-panhtor-dep-skip-v4-2-f84482d7a49c@collabora.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [High] drm/sched: uninitialized ret in
  drm_sched_job_add_dependency_unwrapped()
--

commit dc051a66949e820e818fce4b58132d8dd22aa6c7
Author: Boris Brezillon <boris.brezillon@collabora.com>

drm/sched: Add a drm_sched_job_add_dependency_unwrapped() helper

This commit adds a helper that unwraps fence containers and registers each
contained dma_fence as an individual job dependency.

> diff --git a/drivers/gpu/drm/scheduler/sched_main.c b/drivers/gpu/drm/scheduler/sched_main.c
> index 5f123a5e39ff4..6449d74b5218d 100644
> --- a/drivers/gpu/drm/scheduler/sched_main.c
> +++ b/drivers/gpu/drm/scheduler/sched_main.c

[ ... ]

> @@ -708,6 +709,34 @@ int drm_sched_job_add_dependency(struct drm_sched_job *job,
>  }
>  EXPORT_SYMBOL(drm_sched_job_add_dependency);
>  
> +/**
> + * drm_sched_job_add_dependency_unwrapped - unwrap the fence (if this is a
> + * container) and add the resulting fences as job dependencies
> + * @job: scheduler job to add the dependencies to
> + * @fence: the dma_fence to add to the list of dependencies.
> + *
> + * Note that @fence is consumed in both the success and error cases.
> + *
> + * Returns:
> + * 0 on success, or an error on failing to expand the array.
> + */
> +int drm_sched_job_add_dependency_unwrapped(struct drm_sched_job *job,
> +					   struct dma_fence *fence)
> +{
> +	struct dma_fence *inner_fence;
> +	int ret;
> +
> +	dma_fence_unwrap_for_each(inner_fence, fence) {
> +		ret = drm_sched_job_add_dependency(job, dma_fence_get(inner_fence));
> +		if (ret)
> +			break;
> +	}
> +
> +	dma_fence_put(fence);
> +	return ret;
> +}

[Severity: High]
Should ret be initialized to 0 here?

dma_fence_unwrap_for_each() calls the out-of-line function
dma_fence_unwrap_first() and checks inner_fence before entering the loop
body.  If fence is NULL or a container yields no unsignaled inner fences,
the loop body does not run and ret is returned uninitialized, which also
triggers an uninitialized variable compiler warning.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261202-panhtor-dep-skip-v4-0-f84482d7a49c@collabora.com?part=2

  reply	other threads:[~2026-12-02 11:44 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-02 11:34 [PATCH v4 0/3] drm/panthor: Improve job pipelining Boris Brezillon
2026-12-02 11:34 ` [PATCH v4 1/3] drm/sched: Eliminate NOP dependencies at insertion time Boris Brezillon
2026-12-02 11:44   ` Philipp Stanner
2026-12-02 11:34 ` [PATCH v4 2/3] drm/sched: Add a drm_sched_job_add_dependency_unwrapped() helper Boris Brezillon
2026-12-02 11:44   ` sashiko-bot [this message]
2026-12-02 11:34 ` [PATCH v4 3/3] drm/panthor: Explode container fences to optimize pipelining Boris Brezillon

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-245629@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=boris.brezillon@collabora.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=media-ci@linuxtv.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.