On Mon Nov 3, 2025 at 8:59 AM JST, Joel Fernandes wrote:
<snip>
> diff --git a/drivers/gpu/nova-core/gsp/commands.rs
> b/drivers/gpu/nova-core/gsp/commands.rs
> index 338d1695027f..475c6d9410c5 100644
> --- a/drivers/gpu/nova-core/gsp/commands.rs
> +++ b/drivers/gpu/nova-core/gsp/commands.rs
> @@ -4,16 +4,51 @@
> use kernel::device;
> use kernel::pci;
> use kernel::prelude::*;
> -use kernel::transmute::AsBytes;
> +use kernel::time::Delta;
> +use kernel::transmute::{
> + AsBytes,
> + FromBytes, //
> +};
>
> use super::fw::commands::*;
> use super::fw::MsgFunction;
> use crate::driver::Bar0;
> use crate::gsp::cmdq::Cmdq;
> -use crate::gsp::cmdq::{CommandToGsp, CommandToGspBase,
> CommandToGspWithPayload};
> +use crate::gsp::cmdq::{
> + CommandToGsp,
> + CommandToGspBase,
> + CommandToGspWithPayload,
> + MessageFromGsp, //
> +};
> use crate::gsp::GSP_PAGE_SIZE;
> use crate::sbuffer::SBufferIter;
>
> +/// Message type for GSP initialization done notification.
> +struct GspInitDone {}
> +
> +// SAFETY: GspInitDone is a zero-sized type with no bytes, therefore it
> +// trivially has no uninitialized bytes.
> +unsafe impl AsBytes for GspInitDone {}
This implementation is not needed IIUC.
> +
> +// SAFETY: GspInitDone is a zero-sized type with no bytes, therefore it
> +// trivially has no uninitialized bytes.
> +unsafe impl FromBytes for GspInitDone {}
> +
> +impl MessageFromGsp for GspInitDone {
> + const FUNCTION: MsgFunction = MsgFunction::GspInitDone;
> +}
> +
> +/// Waits for GSP initialization to complete.
> +pub(crate) fn gsp_init_done(cmdq: &mut Cmdq, timeout: Delta) -> Result {
> + loop {
> + match cmdq.receive_msg_from_gsp::<GspInitDone, ()>(timeout, |_, _|
> Ok(())) {
> + Ok(_) => break Ok(()),
Here clippy complains that this should be `Ok(())`.