Re: [PATCH v5 07/15] gpu: nova-core: wait for GFW boot in probe, not in the Gpu constructor

From: Alexandre Courbot

Date: Thu Oct 01 2026 - 10:17:32 EST


On Wed Sep 30, 2026 at 9:51 PM JST, Danilo Krummrich wrote:
> On Wed Sep 30, 2026 at 5:41 AM CEST, John Hubbard wrote:
>> @@ -113,6 +117,14 @@ fn probe<'bound>(
>> pdev.iomap_region(bar1_idx, c"nova-core/bar1")?
>> },
>>
>> + _: {
>> + let spec = Spec::new(pdev.as_ref(), bar)?;
>> +
>> + // We must wait for GFW_BOOT completion before doing any significant setup on
>> + // the GPU.
>> + gpu::wait_gfw_boot_completion(pdev.as_ref(), bar, spec.chipset)?;
>> + },
>
> So, apparently this is done in order to be able to add this
>
> #[cfg(CONFIG_NOVA_CORE_SELFTESTS)]
> crate::irq::doorbell_test::run_selftest(pdev, bar, spec.chipset)?;
>
> in a subsequent patch.
>
> I prefer to make wait_gfw_boot_completion() an associated function of Gpu, keep
> it called from Gpu::new() and guard the whole block with
> #[cfg(CONFIG_NOVA_CORE_SELFTESTS)], such that eventually it becomes:
>
> #[cfg(CONFIG_NOVA_CORE_SELFTESTS)]
> _: {
> let spec = Spec::new(pdev.as_ref(), bar)?;
>
> Gpu::wait_gfw_boot_completion(pdev.as_ref(), bar, spec.chipset)?;
>
> irq::doorbell_test::run_selftest(pdev, bar, spec.chipset)?;
> },
>
> With this Gpu::new() remains self-contained and we don't build up corss
> initialization dependencies.

Indeed, this is architecturally more solid. I can apply the change upon
pushing.