]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
gpu: nova-core: gsp: warn if data remains after processing a message
authorAlexandre Courbot <acourbot@nvidia.com>
Tue, 17 Feb 2026 02:45:49 +0000 (11:45 +0900)
committerAlexandre Courbot <acourbot@nvidia.com>
Tue, 24 Feb 2026 23:17:03 +0000 (08:17 +0900)
Not processing the whole data from a received message is a strong
indicator of a bug - emit a warning when such cases are detected.

Reviewed-by: Lyude Paul <lyude@redhat.com>
Reviewed-by: Danilo Krummrich <dakr@kernel.org>
Link: https://patch.msgid.link/20260217-nova-misc-v3-1-b4e2d45eafbc@nvidia.com
Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
drivers/gpu/nova-core/gsp/cmdq.rs

index 16895f5281b7d94b7ede5152bfd638b7b6b20323..156f1fc91d31a29ae1daf881639d4628dbb8a6de 100644 (file)
@@ -674,7 +674,17 @@ impl Cmdq {
             let (cmd, contents_1) = M::Message::from_bytes_prefix(message.contents.0).ok_or(EIO)?;
             let mut sbuffer = SBufferIter::new_reader([contents_1, message.contents.1]);
 
-            M::read(cmd, &mut sbuffer).map_err(|e| e.into())
+            M::read(cmd, &mut sbuffer)
+                .map_err(|e| e.into())
+                .inspect(|_| {
+                    if !sbuffer.is_empty() {
+                        dev_warn!(
+                            &self.dev,
+                            "GSP message {:?} has unprocessed data\n",
+                            function
+                        );
+                    }
+                })
         } else {
             Err(ERANGE)
         };