]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
gpu: nova-core: gsp: clarify invariant on command queue
authorEliot Courtney <ecourtney@nvidia.com>
Fri, 6 Mar 2026 07:22:02 +0000 (16:22 +0900)
committerAlexandre Courbot <acourbot@nvidia.com>
Tue, 10 Mar 2026 07:07:33 +0000 (16:07 +0900)
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>
drivers/gpu/nova-core/gsp/cmdq.rs

index 8b970523d789af4f89a36abb5210ded2f0e08135..806b1e02715e2be91a468fec2335799ee8849e1b 100644 (file)
@@ -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.