mirror of
https://github.com/torvalds/linux.git
synced 2026-05-27 00:22:00 +02:00
gpu: nova-core: gsp: warn if data remains after processing a message
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>
This commit is contained in:
parent
5cdbed3ad7
commit
b45b9f2668
|
|
@ -674,7 +674,17 @@ pub(crate) fn receive_msg<M: MessageFromGsp>(&mut self, timeout: Delta) -> Resul
|
|||
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)
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user