From f54b0c38bc0db94003978c8f36bc1879a27280bb Mon Sep 17 00:00:00 2001 From: Timur Tabi Date: Thu, 5 Feb 2026 16:59:22 -0600 Subject: [PATCH] gpu: nova-core: program_brom cannot fail Change the signature of the program_brom HAL method to not return anything. None of the implementations can actually fail, so they always return Ok(()). Signed-off-by: Timur Tabi Link: https://patch.msgid.link/20260205225922.2158430-1-ttabi@nvidia.com [acourbot: fix conflicts when applying.] Signed-off-by: Alexandre Courbot --- drivers/gpu/nova-core/falcon.rs | 4 ++-- drivers/gpu/nova-core/falcon/hal.rs | 2 +- drivers/gpu/nova-core/falcon/hal/ga102.rs | 8 +++----- drivers/gpu/nova-core/falcon/hal/tu102.rs | 4 +--- 4 files changed, 7 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/nova-core/falcon.rs b/drivers/gpu/nova-core/falcon.rs index 33927af4134c..24cc2c26e28d 100644 --- a/drivers/gpu/nova-core/falcon.rs +++ b/drivers/gpu/nova-core/falcon.rs @@ -488,7 +488,7 @@ pub(crate) fn pio_load + FalconPioLoadable>( } self.pio_wr_dmem_slice(bar, fw.dmem_load_params())?; - self.hal.program_brom(self, bar, &fw.brom_params())?; + self.hal.program_brom(self, bar, &fw.brom_params()); bar.write( WithBase::of::(), @@ -647,7 +647,7 @@ fn dma_load + FalconDmaLoadable>( )?; self.dma_wr(bar, &dma_obj, FalconMem::Dmem, fw.dmem_load_params())?; - self.hal.program_brom(self, bar, &fw.brom_params())?; + self.hal.program_brom(self, bar, &fw.brom_params()); // Set `BootVec` to start of non-secure code. bar.write( diff --git a/drivers/gpu/nova-core/falcon/hal.rs b/drivers/gpu/nova-core/falcon/hal.rs index a7e5ea8d0272..71df33c79884 100644 --- a/drivers/gpu/nova-core/falcon/hal.rs +++ b/drivers/gpu/nova-core/falcon/hal.rs @@ -46,7 +46,7 @@ fn signature_reg_fuse_version( ) -> Result; /// Program the boot ROM registers prior to starting a secure firmware. - fn program_brom(&self, falcon: &Falcon, bar: &Bar0, params: &FalconBromParams) -> Result; + fn program_brom(&self, falcon: &Falcon, bar: &Bar0, params: &FalconBromParams); /// Check if the RISC-V core is active. /// Returns `true` if the RISC-V core is active, `false` otherwise. diff --git a/drivers/gpu/nova-core/falcon/hal/ga102.rs b/drivers/gpu/nova-core/falcon/hal/ga102.rs index 8368a61ddeef..3df1ffa159b8 100644 --- a/drivers/gpu/nova-core/falcon/hal/ga102.rs +++ b/drivers/gpu/nova-core/falcon/hal/ga102.rs @@ -86,7 +86,7 @@ fn signature_reg_fuse_version_ga102( Ok(u16::BITS - reg_fuse_version.leading_zeros()) } -fn program_brom_ga102(bar: &Bar0, params: &FalconBromParams) -> Result { +fn program_brom_ga102(bar: &Bar0, params: &FalconBromParams) { bar.write( WithBase::of::().at(0), regs::NV_PFALCON2_FALCON_BROM_PARAADDR::zeroed().with_value(params.pkc_data_offset), @@ -104,8 +104,6 @@ fn program_brom_ga102(bar: &Bar0, params: &FalconBromParams) -> WithBase::of::(), regs::NV_PFALCON2_FALCON_MOD_SEL::zeroed().with_algo(FalconModSelAlgo::Rsa3k), ); - - Ok(()) } pub(super) struct Ga102(PhantomData); @@ -131,8 +129,8 @@ fn signature_reg_fuse_version( signature_reg_fuse_version_ga102(&falcon.dev, bar, engine_id_mask, ucode_id) } - fn program_brom(&self, _falcon: &Falcon, bar: &Bar0, params: &FalconBromParams) -> Result { - program_brom_ga102::(bar, params) + fn program_brom(&self, _falcon: &Falcon, bar: &Bar0, params: &FalconBromParams) { + program_brom_ga102::(bar, params); } fn is_riscv_active(&self, bar: &Bar0) -> bool { diff --git a/drivers/gpu/nova-core/falcon/hal/tu102.rs b/drivers/gpu/nova-core/falcon/hal/tu102.rs index c7a90266cb44..d8f5d271811b 100644 --- a/drivers/gpu/nova-core/falcon/hal/tu102.rs +++ b/drivers/gpu/nova-core/falcon/hal/tu102.rs @@ -48,9 +48,7 @@ fn signature_reg_fuse_version( Ok(0) } - fn program_brom(&self, _falcon: &Falcon, _bar: &Bar0, _params: &FalconBromParams) -> Result { - Ok(()) - } + fn program_brom(&self, _falcon: &Falcon, _bar: &Bar0, _params: &FalconBromParams) {} fn is_riscv_active(&self, bar: &Bar0) -> bool { bar.read(regs::NV_PRISCV_RISCV_CORE_SWITCH_RISCV_STATUS::of::())