From: sashiko-bot@kernel.org
To: "Deborah Brouwer" <deborah.brouwer@collabora.com>
Cc: ojeda@kernel.org, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] rust: drm: gpuvm: add SmContext lifetime bound
Date: Thu, 11 Jun 2026 00:12:40 +0000 [thread overview]
Message-ID: <20260611001240.A16811F00893@smtp.kernel.org> (raw)
In-Reply-To: <20260610-gpuvm_smcontext_lifetime_bound_v1-v1-1-531e7d2ee7b4@collabora.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] The `SmMapData` struct fails to compile because it lacks the `T: 'ctx` bound required by its `sm_data` field.
--
commit 79bf9106553be7b558ccc116bf8b7922eb388043
Author: Boris Brezillon <boris.brezillon@collabora.com>
rust: drm: gpuvm: add SmContext lifetime bound
This commit adds a Self: 'ctx bound to DriverGpuVm::SmContext<'ctx> and
propagates it as T: 'ctx to the GPUVM state machine helper types. This allows
drivers to provide lifetime-parameterized implementations of DriverGpuVm.
> diff --git a/rust/kernel/drm/gpuvm/sm_ops.rs b/rust/kernel/drm/gpuvm/sm_ops.rs
> index 69a8e5ab2821f..742c151b2540e 100644
> --- a/rust/kernel/drm/gpuvm/sm_ops.rs
> +++ b/rust/kernel/drm/gpuvm/sm_ops.rs
> @@ -3,7 +3,7 @@
> use super::*;
>
> /// The actual data that gets threaded through the callbacks.
> -struct SmData<'a, 'ctx, T: DriverGpuVm> {
> +struct SmData<'a, 'ctx, T: DriverGpuVm + 'ctx> {
> gpuvm: &'a mut UniqueRefGpuVm<T>,
> user_context: &'a mut T::SmContext<'ctx>,
> }
[ ... ]
> @@ -20,7 +20,7 @@ struct SmMapData<'a, 'ctx, T: DriverGpuVm> {
[Severity: Low]
Will this fail to compile because SmMapData lacks the T: 'ctx bound?
Since SmMapData embeds SmData<'a, 'ctx, T>, which now requires
T: DriverGpuVm + 'ctx, doesn't SmMapData also need the same lifetime bound to
satisfy the requirements of its sm_data field?
> }
>
> /// The argument for [`UniqueRefGpuVm::sm_map`].
> -pub struct OpMapRequest<'a, 'ctx, T: DriverGpuVm> {
> +pub struct OpMapRequest<'a, 'ctx, T: DriverGpuVm + 'ctx> {
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260610-gpuvm_smcontext_lifetime_bound_v1-v1-1-531e7d2ee7b4@collabora.com?part=1
next prev parent reply other threads:[~2026-06-11 0:12 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-11 0:04 [PATCH] rust: drm: gpuvm: add SmContext lifetime bound Deborah Brouwer
2026-06-11 0:12 ` sashiko-bot [this message]
2026-06-11 8:03 ` Alice Ryhl
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=20260611001240.A16811F00893@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=deborah.brouwer@collabora.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=ojeda@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox