From: "Danilo Krummrich" <dakr@kernel.org>
To: "Alexandre Courbot" <acourbot@nvidia.com>
Cc: "Miguel Ojeda" <ojeda@kernel.org>,
"Alex Gaynor" <alex.gaynor@gmail.com>,
"Boqun Feng" <boqun.feng@gmail.com>,
"Gary Guo" <gary@garyguo.net>,
"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
"Benno Lossin" <lossin@kernel.org>,
"Andreas Hindborg" <a.hindborg@kernel.org>,
"Alice Ryhl" <aliceryhl@google.com>,
"Trevor Gross" <tmgross@umich.edu>,
"David Airlie" <airlied@gmail.com>,
"Simona Vetter" <simona@ffwll.ch>,
"Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
"Maxime Ripard" <mripard@kernel.org>,
"Thomas Zimmermann" <tzimmermann@suse.de>,
"John Hubbard" <jhubbard@nvidia.com>,
"Alistair Popple" <apopple@nvidia.com>,
"Joel Fernandes" <joelagnelf@nvidia.com>,
"Timur Tabi" <ttabi@nvidia.com>,
rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org,
nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v3 02/11] gpu: nova-core: move GSP boot code out of `Gpu` constructor
Date: Wed, 10 Sep 2025 13:22:36 +0200 [thread overview]
Message-ID: <DCP2XZWK4X7O.E8CW9LMKRU3I@kernel.org> (raw)
In-Reply-To: <DCP2UI9NGTQ6.3O0ARTPL4WCA2@nvidia.com>
On Wed Sep 10, 2025 at 1:18 PM CEST, Alexandre Courbot wrote:
> On Wed Sep 10, 2025 at 5:01 PM JST, Danilo Krummrich wrote:
>> On Wed Sep 10, 2025 at 6:48 AM CEST, Alexandre Courbot wrote:
>>> On Tue Sep 9, 2025 at 11:43 PM JST, Danilo Krummrich wrote:
>>>> impl Gpu {
>>>> pub(crate) fn new<'a>(
>>>> dev: &'a Device<Bound>,
>>>> bar: &'a Bar0
>>>> devres_bar: Arc<Devres<Bar0>>,
>>>> ) -> impl PinInit<Self, Error> + 'a {
>>>> try_pin_init(Self {
>>>> bar: devres_bar,
>>>> spec: Spec::new(bar)?,
>>>> gsp_falcon: Falcon::<Gsp>::new(dev, spec.chipset)?,
>>>> sec2_falcon: Falcon::<Sec2>::new(dev, spec.chipset)?,
>>>> sysmem_flush: SysmemFlush::register(dev, bar, spec.chipset)?
>>>> gsp <- Gsp::new(gsp_falcon, sec2_falcon, sysmem_flush)?,
>>>> })
>>>> }
>>>> }
>>>
>>> It does work. The bizareness of passing the `bar` twice aside,
>>
>> Yeah, but it really seems like a minor inconvinience. (Especially, since this
>> will be the only occurance of this we'll ever have.)
>
> It's definitely not a big deal.
>
>>
>>> 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 `)`
Yeah, you also need this patch [1].
[1] https://lore.kernel.org/all/20250905140534.3328297-1-lossin@kernel.org/
next prev parent reply other threads:[~2025-09-10 11:22 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-02 14:31 [PATCH v3 00/11] gpu: nova-core: process and prepare more firmwares to boot GSP Alexandre Courbot
2025-09-02 14:31 ` [PATCH v3 01/11] gpu: nova-core: require `Send` on `FalconEngine` and `FalconHal` Alexandre Courbot
2025-09-02 14:31 ` [PATCH v3 02/11] gpu: nova-core: move GSP boot code out of `Gpu` constructor Alexandre Courbot
2025-09-02 19:53 ` Danilo Krummrich
2025-09-03 7:08 ` Alexandre Courbot
2025-09-03 7:21 ` Alexandre Courbot
2025-09-03 8:26 ` Danilo Krummrich
2025-09-03 10:44 ` Alexandre Courbot
2025-09-03 11:05 ` Danilo Krummrich
2025-09-03 12:29 ` Alexandre Courbot
2025-09-03 14:53 ` Danilo Krummrich
2025-09-04 15:28 ` Joel Fernandes
2025-09-02 23:12 ` Danilo Krummrich
2025-09-03 7:10 ` Alexandre Courbot
2025-09-03 8:27 ` Danilo Krummrich
2025-09-09 14:11 ` Alexandre Courbot
2025-09-09 14:43 ` Danilo Krummrich
2025-09-10 4:48 ` Alexandre Courbot
2025-09-10 8:01 ` Danilo Krummrich
2025-09-10 11:18 ` Alexandre Courbot
2025-09-10 11:22 ` Alexandre Courbot
2025-09-10 11:22 ` Danilo Krummrich [this message]
2025-09-02 14:31 ` [PATCH v3 03/11] gpu: nova-core: add Chipset::name() method Alexandre Courbot
2025-09-02 14:31 ` [PATCH v3 04/11] gpu: nova-core: firmware: move firmware request code into a function Alexandre Courbot
2025-09-02 14:31 ` [PATCH v3 05/11] gpu: nova-core: firmware: add support for common firmware header Alexandre Courbot
2025-09-02 14:32 ` [PATCH v3 06/11] gpu: nova-core: firmware: process Booter and patch its signature Alexandre Courbot
2025-09-02 14:32 ` [PATCH v3 07/11] gpu: nova-core: firmware: process and prepare the GSP firmware Alexandre Courbot
2025-09-02 14:32 ` [PATCH v3 08/11] gpu: nova-core: firmware: process the GSP bootloader Alexandre Courbot
2025-09-02 14:32 ` [PATCH v3 09/11] gpu: nova-core: firmware: use 570.144 firmware Alexandre Courbot
2025-09-02 14:32 ` [PATCH v3 10/11] gpu: nova-core: Add base files for r570.144 firmware bindings Alexandre Courbot
2025-09-02 14:32 ` [PATCH v3 11/11] gpu: nova-core: compute layout of more framebuffer regions required for GSP Alexandre Courbot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=DCP2XZWK4X7O.E8CW9LMKRU3I@kernel.org \
--to=dakr@kernel.org \
--cc=a.hindborg@kernel.org \
--cc=acourbot@nvidia.com \
--cc=airlied@gmail.com \
--cc=alex.gaynor@gmail.com \
--cc=aliceryhl@google.com \
--cc=apopple@nvidia.com \
--cc=bjorn3_gh@protonmail.com \
--cc=boqun.feng@gmail.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=gary@garyguo.net \
--cc=jhubbard@nvidia.com \
--cc=joelagnelf@nvidia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lossin@kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=nouveau@lists.freedesktop.org \
--cc=ojeda@kernel.org \
--cc=rust-for-linux@vger.kernel.org \
--cc=simona@ffwll.ch \
--cc=tmgross@umich.edu \
--cc=ttabi@nvidia.com \
--cc=tzimmermann@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.