From: Timur Tabi Date: Thu, 5 Feb 2026 22:59:22 +0000 (-0600) Subject: gpu: nova-core: program_brom cannot fail X-Git-Tag: v7.2-rc1~141^2~3^2~97 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f54b0c38bc0db94003978c8f36bc1879a27280bb;p=thirdparty%2Fkernel%2Flinux.git 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 --- diff --git a/drivers/gpu/nova-core/falcon.rs b/drivers/gpu/nova-core/falcon.rs index 33927af4134c1..24cc2c26e28de 100644 --- a/drivers/gpu/nova-core/falcon.rs +++ b/drivers/gpu/nova-core/falcon.rs @@ -488,7 +488,7 @@ impl Falcon { } 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 @@ impl Falcon { )?; 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 a7e5ea8d0272c..71df33c79884a 100644 --- a/drivers/gpu/nova-core/falcon/hal.rs +++ b/drivers/gpu/nova-core/falcon/hal.rs @@ -46,7 +46,7 @@ pub(crate) trait FalconHal: Send + Sync { ) -> 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 8368a61ddeef5..3df1ffa159b8a 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 @@ impl FalconHal for Ga102 { 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 c7a90266cb445..d8f5d271811b4 100644 --- a/drivers/gpu/nova-core/falcon/hal/tu102.rs +++ b/drivers/gpu/nova-core/falcon/hal/tu102.rs @@ -48,9 +48,7 @@ impl FalconHal for Tu102 { 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::())