[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <DCP2XKCMMOV0.2VHHLLY7C8PSY@nvidia.com>
Date: Wed, 10 Sep 2025 20:22:02 +0900
From: "Alexandre Courbot" <acourbot@...dia.com>
To: "Alexandre Courbot" <acourbot@...dia.com>, "Danilo Krummrich"
<dakr@...nel.org>
Cc: "Miguel Ojeda" <ojeda@...nel.org>, "Alex Gaynor"
<alex.gaynor@...il.com>, "Boqun Feng" <boqun.feng@...il.com>, "Gary Guo"
<gary@...yguo.net>, Björn Roy Baron
<bjorn3_gh@...tonmail.com>, "Benno Lossin" <lossin@...nel.org>, "Andreas
Hindborg" <a.hindborg@...nel.org>, "Alice Ryhl" <aliceryhl@...gle.com>,
"Trevor Gross" <tmgross@...ch.edu>, "David Airlie" <airlied@...il.com>,
"Simona Vetter" <simona@...ll.ch>, "Maarten Lankhorst"
<maarten.lankhorst@...ux.intel.com>, "Maxime Ripard" <mripard@...nel.org>,
"Thomas Zimmermann" <tzimmermann@...e.de>, "John Hubbard"
<jhubbard@...dia.com>, "Alistair Popple" <apopple@...dia.com>, "Joel
Fernandes" <joelagnelf@...dia.com>, "Timur Tabi" <ttabi@...dia.com>,
<rust-for-linux@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<nouveau@...ts.freedesktop.org>, <dri-devel@...ts.freedesktop.org>
Subject: Re: [PATCH v3 02/11] gpu: nova-core: move GSP boot code out of
`Gpu` constructor
On Wed Sep 10, 2025 at 8:18 PM JST, Alexandre Courbot wrote:
>>> here is what it looks like when I got it to compile:
>>
>> This looks great!
>>
>>> pub(crate) fn new<'a>(
>>> pdev: &'a pci::Device<device::Bound>,
>>> devres_bar: Arc<Devres<Bar0>>,
>>> bar: &'a Bar0,
>>> ) -> impl PinInit<Self, Error> + 'a {
>>> try_pin_init!(Self {
>>> spec: Spec::new(bar).inspect(|spec| {
>>> dev_info!(
>>> pdev.as_ref(),
>>> "NVIDIA (Chipset: {}, Architecture: {:?}, Revision: {})\n",
>>> spec.chipset,
>>> spec.chipset.arch(),
>>> spec.revision
>>> );
>>> })?,
>>
>> + _: {
>> + gfw::wait_gfw_boot_completion(bar)
>> + .inspect_err(|_| dev_err!(pdev.as_ref(), "GFW boot did not complete"))?;
>> + },
>>>
>>> sysmem_flush: SysmemFlush::register(pdev.as_ref(), bar, spec.chipset)?,
>>>
>>> gsp_falcon: Falcon::<Gsp>::new(
>>> pdev.as_ref(),
>>> spec.chipset,
>>> bar,
>>> spec.chipset > Chipset::GA100,
>>> )
>>> .inspect(|falcon| falcon.clear_swgen0_intr(bar))?,
>>>
>>> sec2_falcon: Falcon::<Sec2>::new(pdev.as_ref(), spec.chipset, bar, true)?,
>>>
>> - gsp: Self::start_gsp(pdev, bar, spec.chipset, gsp_falcon, sec2_falcon)?,
>> + gsp <- Self::start_gsp(pdev, bar, spec.chipset, gsp_falcon, sec2_falcon),
>>>
>>> bar: devres_bar,
>>> })
>>> }
>>>
>>> The wait for GFW initialization had to be moved to `probe`, but that's
>>> fine IMO.
>>
>> That's not necessary, you can keep it in Gpu::new() -- I don't see what's
>> preventing us from that. I inserted it in the code above.
>
> This one didn't work for me, but maybe you have a newer version of the
> internal references patch:
>
> error: no rules expected reserved identifier `_`
> --> drivers/gpu/nova-core/gpu.rs:323:13
> |
> 323 | _: {
> | ^ no rules expected this token in macro call
> |
> note: while trying to match `)`
Ah, just found out about this, neat!
https://lore.kernel.org/rust-for-linux/20250905140534.3328297-1-lossin@kernel.org/
Powered by blists - more mailing lists