summaryrefslogtreecommitdiff
path: root/drivers/gpu/nova-core
diff options
context:
space:
mode:
authorEliot Courtney <ecourtney@nvidia.com>2026-03-06 16:22:02 +0900
committerAlexandre Courbot <acourbot@nvidia.com>2026-03-10 16:07:33 +0900
commit1a0d4bc62b5d36a8ae4dca4413c2703b5fdd93f4 (patch)
tree9bed1439092db5fc89d759384c62b193d5587cb8 /drivers/gpu/nova-core
parent41584c71342e6046fc5af0bd7823e6c0c53ffb0c (diff)
downloadlinux-next-1a0d4bc62b5d36a8ae4dca4413c2703b5fdd93f4.tar.gz
linux-next-1a0d4bc62b5d36a8ae4dca4413c2703b5fdd93f4.zip
gpu: nova-core: gsp: clarify invariant on command queue
Clarify why using only the first returned slice from allocate_command for the message headers is okay. Tested-by: Zhi Wang <zhiw@nvidia.com> Signed-off-by: Eliot Courtney <ecourtney@nvidia.com> Link: https://patch.msgid.link/20260306-cmdq-continuation-v6-5-cc7b629200ee@nvidia.com Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Diffstat (limited to 'drivers/gpu/nova-core')
-rw-r--r--drivers/gpu/nova-core/gsp/cmdq.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/gpu/nova-core/gsp/cmdq.rs b/drivers/gpu/nova-core/gsp/cmdq.rs
index 8b970523d789..806b1e02715e 100644
--- a/drivers/gpu/nova-core/gsp/cmdq.rs
+++ b/drivers/gpu/nova-core/gsp/cmdq.rs
@@ -534,7 +534,9 @@ impl Cmdq {
.gsp_mem
.allocate_command(command_size, Self::ALLOCATE_TIMEOUT)?;
- // Extract area for the command itself.
+ // Extract area for the command itself. The GSP message header and the command header
+ // together are guaranteed to fit entirely into a single page, so it's ok to only look
+ // at `dst.contents.0` here.
let (cmd, payload_1) = M::Command::from_bytes_mut_prefix(dst.contents.0).ok_or(EIO)?;
// Fill the header and command in-place.