From: "Alexandre Courbot" <acourbot@nvidia.com>
To: "Tim Kovalenko" <tim.kovalenko@proton.me>
Cc: "Danilo Krummrich" <dakr@kernel.org>,
"Alice Ryhl" <aliceryhl@google.com>,
"David Airlie" <airlied@gmail.com>,
"Simona Vetter" <simona@ffwll.ch>,
"Paul Walmsley" <pjw@kernel.org>,
"Palmer Dabbelt" <palmer@dabbelt.com>,
"Albert Ou" <aou@eecs.berkeley.edu>,
"Alexandre Ghiti" <alex@ghiti.fr>, <nova-gpu@lists.linux.dev>,
<dri-devel@lists.freedesktop.org>, <linux-kernel@vger.kernel.org>,
<linux-riscv@lists.infradead.org>
Subject: Re: [PATCH] gpu: nova-core: falcon: store bar and dev in falcon
Date: Thu, 25 Jun 2026 15:56:46 +0900 [thread overview]
Message-ID: <DJHXNCN5G5BN.12UU16RF1GQHP@nvidia.com> (raw)
In-Reply-To: <20260624-drm-bar-refactor-v1-1-7062899163c5@proton.me>
Hi Tim, thanks for the patch!
On Thu Jun 25, 2026 at 12:51 AM JST, Tim Kovalenko wrote:
> Store the bound device and `BAR0` mapping in `Falcon` instead of passing
> them through every `Falcon` operation. This simplifies the `Falcon` API and
> removes repeated `dev`/`bar` plumbing from reset, load, boot, mailbox, DMA,
> and GSP/FSP-specific Falcon helpers.
>
> Add a named helper for configuring Falcon FBIF transaction slots for
> physical coherent system memory, avoiding direct `BAR0` access from the
> FWSEC bootloader path without exposing BAR0 publicly.
>
> Future work / questions:
Questions are not something we want to appear in the final git log, so
please move such comments to after the `---` mark. If you use b4, this
is where the cover letter text will be placed on single-patch series.
>
> - Focused only on the Falcon for this patch - more to follow.
>
> - Not sure about the FalconHal and if I should modify the Trait
> - Could be part of the next patch
> - But it could definitively be simplified
Every HAL method takes the `Falcon` as a parameter, so it is able
to access its `bar` and `dev`. I think it makes sense to remove the
parameters there as well when possible.
>
> - Also, how far should the refactor go and to what extend add new
> methods to avoid passing `bar` or `dev` but also not exposing them as
> pub. For `dev`, there's a lot of `dev_err` usage that requires us to
> pass it as a param.
> - I've created the `set_fbif_transcfg_phys_sysmem` method to
> address such issue and remove some code duplication but that
> method could be made a bit more generic.
If you add new methods, these should come as separate patches, and be
thoroughly thought - `set_fbif_transcfg_phys_sysmem` seems a bit too
ad-hoc to me. It looks like the proper fix for this access to
`NV_PFALCON_FBIF_TRANSCFG` is more something like moving it to
`Falcon::pio_load` or something, but this is a separate problem.
Let's keep the patch focused on `Falcon` itself, and keep the `bar`
argument of `FwsecFirmwareWithBl::run` until we figure out the right way
to address this. We don't need to clean up everything in one go.
>
> - Also, is there a reason why we are not passing the `GspBootContext`
> when we need stuff like `bar`, `dev` and both falcons?
`GspBootContext` was recently introduced, and yes we want to use it
more, but there are plans to make it generic and until we know what it
will look like I would like to limit its use. So for this patch, better
to keep things simple and mechanical.
>
> Reported-by: Alexandre Courbot <acourbot@nvidia.com>
This is not a bug, so `Suggested-by:` is more accurate I think.
> Closes: https://rust-for-linux.zulipchat.com/#narrow/channel/509436-Nova/topic/Storing.20driver-bound.20references.20into.20sub-devices/near/599137882
This can be `Link:`, as this patch by itself doesn't fix them all yet.
The patch itself clearly makes things more readable, and looks like what
I had in mind - modulo the addition of new methods that I would prefer
to see taken care of separately. If you can send a v2 that focuses
strictly on falcon and does not introduce new methods, I think that
would be perfect.
next prev parent reply other threads:[~2026-06-25 6:56 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-24 15:51 [PATCH] gpu: nova-core: falcon: store bar and dev in falcon Tim Kovalenko
2026-06-25 6:56 ` Alexandre Courbot [this message]
-- strict thread matches above, loose matches on Subject: below --
2026-06-24 15:49 Tim Kovalenko
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=DJHXNCN5G5BN.12UU16RF1GQHP@nvidia.com \
--to=acourbot@nvidia.com \
--cc=airlied@gmail.com \
--cc=alex@ghiti.fr \
--cc=aliceryhl@google.com \
--cc=aou@eecs.berkeley.edu \
--cc=dakr@kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=nova-gpu@lists.linux.dev \
--cc=palmer@dabbelt.com \
--cc=pjw@kernel.org \
--cc=simona@ffwll.ch \
--cc=tim.kovalenko@proton.me \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox