Re: [PATCH v2 07/11] gpu: nova-core: vbios: keep PmuLookupTable local in setup_falcon_data

From: Joel Fernandes

Date: Thu Apr 16 2026 - 11:57:13 EST




On 4/14/2026 7:54 AM, Eliot Courtney wrote:
> This does not need to be stored, so we can remove it.

Need more words/description, but patch is good.

Reviewed-by: Joel Fernandes <joelagnelf@xxxxxxxxxx>

Thanks.


>
> Signed-off-by: Eliot Courtney <ecourtney@xxxxxxxxxx>
> ---
> drivers/gpu/nova-core/vbios.rs | 25 ++++++-------------------
> 1 file changed, 6 insertions(+), 19 deletions(-)
>
> diff --git a/drivers/gpu/nova-core/vbios.rs b/drivers/gpu/nova-core/vbios.rs
> index d63af95eb642..01f65d50cbb3 100644
> --- a/drivers/gpu/nova-core/vbios.rs
> +++ b/drivers/gpu/nova-core/vbios.rs
> @@ -256,7 +256,6 @@ pub(crate) fn new(dev: &device::Device, bar0: &Bar0) -> Result<Vbios> {
> Ok(BiosImageType::FwSec) => {
> let fwsec = FwSecBiosBuilder {
> base: image,
> - pmu_lookup_table: None,
> falcon_ucode_offset: None,
> };
> if first_fwsec_image.is_none() {
> @@ -630,8 +629,6 @@ struct FwSecBiosBuilder {
> /// Once FwSecBiosBuilder is constructed, the `falcon_ucode_offset` will be copied into a new
> /// [`FwSecBiosImage`].
> ///
> - /// The [`PmuLookupTable`] starts at the offset of the falcon data pointer.
> - pmu_lookup_table: Option<PmuLookupTable>,
> /// The offset of the Falcon ucode.
> falcon_ucode_offset: Option<usize>,
> }
> @@ -931,24 +928,14 @@ fn setup_falcon_data(
> offset -= first_fwsec.base.data.len();
> }
>
> - if pmu_in_first_fwsec {
> - self.pmu_lookup_table = Some(PmuLookupTable::new(
> - &self.base.dev,
> - &first_fwsec.base.data[offset..],
> - )?);
> + let pmu_lookup_data = if pmu_in_first_fwsec {
> + &first_fwsec.base.data[offset..]
> } else {
> - self.pmu_lookup_table = Some(PmuLookupTable::new(
> - &self.base.dev,
> - &self.base.data[offset..],
> - )?);
> - }
> + self.base.data.get(offset..).ok_or(EINVAL)?
> + };
> + let pmu_lookup_table = PmuLookupTable::new(&self.base.dev, pmu_lookup_data)?;
>
> - match self
> - .pmu_lookup_table
> - .as_ref()
> - .ok_or(EINVAL)?
> - .find_entry_by_type(FALCON_UCODE_ENTRY_APPID_FWSEC_PROD)
> - {
> + match pmu_lookup_table.find_entry_by_type(FALCON_UCODE_ENTRY_APPID_FWSEC_PROD) {
> Ok(entry) => {
> self.falcon_ucode_offset = Some(
> usize::from_safe_cast(entry.data)
>