Re: [PATCH] gpu: nova-core: gsp: move Cmdq's DMA handle to a struct member

From: Danilo Krummrich

Date: Fri Mar 20 2026 - 08:53:57 EST


On Thu Mar 19, 2026 at 7:00 AM CET, Alexandre Courbot wrote:
> The command-queue structure has a `dma_handle` method that returns the
> DMA handle to the memory segment shared with the GSP. This works, but is
> not ideal for the following reasons:
>
> - That method is effectively only ever called once, and is technically
> an accessor method since the handle doesn't change over time,
> - It feels a bit out-of-place with the other methods of `Cmdq` which
> only deal with the sending or receiving of messages,
> - The method has `pub(crate)` visibility, allowing other driver code to
> access this highly-sensitive handle.
>
> Address all these issues by turning `dma_handle` into a struct member
> with `pub(super)` visibility. This keeps the method space focused, and
> also ensures the member is not visible outside of the modules that need
> it.
>
> Signed-off-by: Alexandre Courbot <acourbot@xxxxxxxxxx>

Linking my note from the original patch series [1].

Reviewed-by: Danilo Krummrich <dakr@xxxxxxxxxx>

[1] https://lore.kernel.org/all/DH60S91O053Z.1DDUJSL0D6NQQ@xxxxxxxxxx/