Re: [PATCH v3 17/33] gpu: nova-core: add the r000 load-and-execute bootloader handler

From: Timur Tabi

Date: Thu Sep 17 2026 - 23:32:30 EST


On Thu, 2026-09-17 at 18:07 -0700, John Hubbard wrote:
> @@ -133,6 +141,75 @@ fn core_resume(&self) -> Result {
>          Ok(())
>      }
>  
> +    /// Runs the generic bootloader on the GSP falcon, as a
> `GMCAPI_CMD_EXEC_GENERIC_BOOTLOADER`
> +    /// event requests, and then restarts GSP-RM.
> +    ///
> +    /// The descriptor that the event carries names the image that the bootloader loads.
> +    ///
> +    /// # Errors
> +    ///
> +    /// - `EINVAL` if this chipset boots without the generic bootloader, if the payload is
> shorter
> +    ///   than the parameter block, if the descriptor is not the size that this driver
> defines for
> +    ///   it, or if the event names a context DMA slot or an aperture that does not exist.
> +    /// - `ETIMEDOUT` if the RISC-V core does not suspend within two seconds, or the GSP
> falcon does
> +    ///   not halt within two seconds of starting the image.
> +    ///
> +    /// Errors from [`Self::core_resume`] are propagated as-is.
> +    #[expect(dead_code)]
> +    fn handle_load_exec_bootloader(&self, payload_0: &[u8], payload_1: &[u8]) -> Result {
> +        let Self {
> +            gsp_falcon, dev, ..
> +        } = *self;

Why do you create local variables of two member of LoadExecContext? By doing this:

let Self {
gsp_falcon, dev, ..
} = *self;

you force every member of LoadExecContext to implement Copy, even the ones you are not copying
here.

> + if params.dmem_desc_size != BootloaderDmemDescV2::SIZE {
> + dev_err!(
> + dev,
> + "Load-exec descriptor is {} bytes, expected {}\n",
> + params.dmem_desc_size,
> + BootloaderDmemDescV2::SIZE
> + );

So here, why not just do self.dev?