]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
gpu: nova-core: gsp: move Cmdq's DMA handle to a struct member
authorAlexandre Courbot <acourbot@nvidia.com>
Thu, 19 Mar 2026 06:00:40 +0000 (15:00 +0900)
committerAlexandre Courbot <acourbot@nvidia.com>
Tue, 24 Mar 2026 06:45:22 +0000 (15:45 +0900)
commit651c27d6a7e2b92eb30f56738dc45e861c975921
tree6276393f61ea822c2b46379f30258b9fc308c5e1
parent55fd681cdd8599edc82013674cbf87c2f22d58f8
gpu: nova-core: gsp: move Cmdq's DMA handle to a struct member

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.

Reviewed-by: Eliot Courtney <ecourtney@nvidia.com>
Reviewed-by: Danilo Krummrich <dakr@kernel.org>
Link: https://patch.msgid.link/20260319-b4-cmdq-dma-handle-v1-1-57840b4a4f90@nvidia.com
Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
drivers/gpu/nova-core/gsp/cmdq.rs
drivers/gpu/nova-core/gsp/fw.rs