Re: [PATCH v3 13/33] gpu: nova-core: separate the generic falcon bootloader from FWSEC
From: John Hubbard
Date: Mon Sep 21 2026 - 22:39:53 EST
On 9/18/26 3:04 PM, Timur Tabi wrote:
> On Thu, 2026-09-17 at 18:06 -0700, John Hubbard wrote:
>>
>
>> diff --git a/drivers/gpu/nova-core/falcon.rs b/drivers/gpu/nova-core/falcon.rs
>> index 9015de965a53..04e35cbcb6f0 100644
>> --- a/drivers/gpu/nova-core/falcon.rs
>> +++ b/drivers/gpu/nova-core/falcon.rs
>> @@ -385,6 +385,14 @@ pub(crate) fn new(
>> })
>> }
>>
>> + /// Returns the size of this falcon's IMEM in bytes.
>> + pub(crate) fn imem_size(&self) -> usize {
>> + let blocks =
>> +
>> usize::from_safe_cast(*self.pfalcon.read(regs::NV_PFALCON_FALCON_HWCFG).imem_size());
>
> Why is this `*self` instead of just `self`?
Because the star is not "attached" to self, actually. Because: A method
call binds tighter than the unary operator, so the above is actually
dereferencing the Bounded<u32, 9> that imem_size() returns.
However, in order to improve readability, I've changed this in v4, to
use usize::from(...) instead, the form that the fb HALs already use for
a register field. And also done that for the two GSP pointer reads in the
big switch-over patch.
thanks,
--
John Hubbard