From: Eliot Courtney Date: Fri, 6 Mar 2026 07:22:02 +0000 (+0900) Subject: gpu: nova-core: gsp: clarify invariant on command queue X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1a0d4bc62b5d36a8ae4dca4413c2703b5fdd93f4;p=thirdparty%2Fkernel%2Flinux.git 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 Signed-off-by: Eliot Courtney Link: https://patch.msgid.link/20260306-cmdq-continuation-v6-5-cc7b629200ee@nvidia.com Signed-off-by: Alexandre Courbot --- diff --git a/drivers/gpu/nova-core/gsp/cmdq.rs b/drivers/gpu/nova-core/gsp/cmdq.rs index 8b970523d789a..806b1e02715e2 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.