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 <[email protected]>

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-531e7d2ee...@collabora.com?part=1

Reply via email to