Re: [PATCH v9 06/31] gpu: nova-core: Hopper/Blackwell: skip GFW boot waiting

John Hubbard
2026-03-30T19:15:53Z

On 3/30/26 11:33 AM, Joel Fernandes wrote:
> On 3/30/2026 10:52 AM, Alexandre Courbot wrote:
>> On Thu Mar 26, 2026 at 10:38 AM JST, John Hubbard wrote:
...
>>> +pub(crate) trait GpuHal {
>>> + /// Waits for GFW_BOOT completion if required by this hardware family.
>>> + fn wait_gfw_boot_completion(&self, bar: &Bar0) -> Result;
>>> +}
>>> +
>>> +struct Tu102;
>>> +struct Gh100;
>>> +
>>> +impl GpuHal for Tu102 {
>>> + fn wait_gfw_boot_completion(&self, bar: &Bar0) -> Result {
>>> + gfw::wait_gfw_boot_completion(bar)
>>> + }
>>> +}
>>> +
>>> +impl GpuHal for Gh100 {
>>> + fn wait_gfw_boot_completion(&self, _bar: &Bar0) -> Result {
>>> + Ok(())
>>> + }
>>> +}
>>
>> Please take a look at how other HALs are implemented: each HAL instance
>> is in its own module. That's not just a cosmetic choice; it allows us to
>> keep the chipset's specific HAL struct and its helpers completely
>> private and forces us to make code-sharing explicit. Furthermore, this
>> particular HAL is bound to grow, so let's split it properly from the
>> start.
>>
>> If you do that it also makes more sense to use constants (contrary to
>> Gary's feedback on v8), if only to align with the rest of the driver.
>>
>> Once this is done, making `gpu::hal::tu102` absorb the `gfw` module is
>> trivial, so let's do that while we are at it - having `gfw` as being
>> driver-wide makes little sense since it has a very limited role for a
>> specific subset of the chips we support.
>
> I feel a HAL might be overkill for this. Looking at the series, this is also the
> only method. I am doubtful future architectures will have to once again wait for
> GFW boot (is that expected?).

Definitely not! We are moving to futurue firmware that does all of its
own initialization, without all of these intrusive and fussy
steps and interventions from the kernel driver that we are doing
today.

>
> If not, we can just match or conditional on .arch(). We do that already in other
> places.
>
> Something like:
> if spec.chipset().arch() < Architecture::Hopper {
> gfw::wait_gfw_boot_completion(bar)?;
> }
>
>
> Thoughts?
>

I have a feeling this matches an earlier version of the patchset,
actually. :).

I also think a HAL for this tiny aspect is overkill, but I also don't
really mind either putting it into a HAL, or not. Because either
way the code is readable.

thanks,
John Hubbard