From: "Alexandre Courbot" <acourbot@nvidia.com>
To: "Antonin Malzieu Ridolfi via B4 Relay"
<devnull+dev.nanonej.com@kernel.org>
Cc: <dev@nanonej.com>, "Danilo Krummrich" <dakr@kernel.org>,
"Alice Ryhl" <aliceryhl@google.com>,
"David Airlie" <airlied@gmail.com>,
"Simona Vetter" <simona@ffwll.ch>, <linux-kernel@vger.kernel.org>,
<nova-gpu@lists.linux.dev>, <dri-devel@lists.freedesktop.org>,
<daniel.almeida@collabora.com>
Subject: Re: [PATCH 2/5] gpu: nova-core: gsp: Move PBUS register definition
Date: Tue, 23 Jun 2026 15:18:58 +0900 [thread overview]
Message-ID: <DJG7LBVUQ0FA.2G12DPFA5RWQT@nvidia.com> (raw)
In-Reply-To: <20260617-nova-core-regs-split-v1-2-4c7dc4450ea7@nanonej.com>
On Wed Jun 17, 2026 at 8:48 AM JST, Antonin Malzieu Ridolfi via B4 Relay wrote:
> From: Antonin Malzieu Ridolfi <dev@nanonej.com>
>
> Move PBUS register definition into gsp module and update registers
> visibility.
>
> Signed-off-by: Antonin Malzieu Ridolfi <dev@nanonej.com>
This one also didn't pass `rustfmtcheck` - please make sure to run the
checklist [1] (notably `rustfmt`) on each patch before submitting.
Some more comments below.
[1] https://rust-for-linux.com/contributing#submit-checklist-addendum
> ---
> drivers/gpu/nova-core/gsp/hal/tu102.rs | 12 ++++++------
> drivers/gpu/nova-core/gsp/regs.rs | 11 +++++++++++
> drivers/gpu/nova-core/regs.rs | 11 -----------
> 3 files changed, 17 insertions(+), 17 deletions(-)
>
> diff --git a/drivers/gpu/nova-core/gsp/hal/tu102.rs b/drivers/gpu/nova-core/gsp/hal/tu102.rs
> index eb7166148cc9..d46e8ec65785 100644
> --- a/drivers/gpu/nova-core/gsp/hal/tu102.rs
> +++ b/drivers/gpu/nova-core/gsp/hal/tu102.rs
> @@ -37,6 +37,7 @@
> GspHal,
> UnloadBundle, //
> },
> + regs,
> sequencer::{
> GspSequencer,
> GspSequencerParams, //
> @@ -44,7 +45,6 @@
> Gsp,
> GspFwWprMeta, //
> },
> - regs,
> vbios::Vbios, //
> };
>
> @@ -141,7 +141,7 @@ fn run(
> .inspect_err(|e| dev_err!(dev, "FWSEC-SB failed to run: {:?}\n", e));
>
> // Remove WPR2 region if set.
> - let wpr2_hi = bar.read(regs::NV_PFB_PRI_MMU_WPR2_ADDR_HI);
> + let wpr2_hi = bar.read(crate::regs::NV_PFB_PRI_MMU_WPR2_ADDR_HI);
It would be nice if we could avoid re-scoping registers that don't move,
and I think we can achieve that as part of a slightly larger series.
Notice how we are accessing `PFB` registers (`WPR2_ADDR_HI` and
`WPR_ADDR_LO`) despite being in the `gsp` module. Let's start by fixing
that.
These two registers are only ever accessed by the GSP's TU102 HAL to
check whether a WPR2 region (a memory range going between `ADDR_LO` and
`ADDR_HI`) is set and what its range is. The TU102 code manipulates
these registers directly, but we could move them to the right place if
we did that as a FB service.
There could be a function in the `fb` module that reads the registers
and returns an `Option<Range<u64>>` - `None` if `is_wpr2_set` is
`false`, or the WPR2 range otherwise. Then the GSP TU102 HAL would just
use this function instead of poking the register as it currently does.
Doing so would move the WPR2 registers to the right place, and provide the
right abstraction for the WPR2 region.
A patch series doing this could look like this:
- Add the `fb` module function abstracting the WPR2 region registers and
use it in the GSP's TU102 HAL.
- Move the `NV_PFB_PRI_MMU_WPR2_ADDR*` registers under the `fb` module.
- Move the `NV_PBUS_SW_SCRATCH_0E_FRTS_ERR` register under the `gsp`
module, since it is clearly themed after `FRTS`, which is part of the
GSP boot. But, without moving `NV_PBUS_SW_SCRATCH` (the actual
register being aliased). I expect you will hit a bug of the `register`
macro when doing this one - I'll try to address it, but the first two
steps should be safe to do and correct.
next prev parent reply other threads:[~2026-06-23 6:19 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-16 23:48 [PATCH 0/5] gpu: nova-core: Move registers definitions Antonin Malzieu Ridolfi via B4 Relay
2026-06-16 23:48 ` [PATCH 1/5] gpu: nova-core: fb: Move PDISP register definition Antonin Malzieu Ridolfi via B4 Relay
2026-06-23 6:18 ` Alexandre Courbot
2026-06-16 23:48 ` [PATCH 2/5] gpu: nova-core: gsp: Move PBUS " Antonin Malzieu Ridolfi via B4 Relay
2026-06-23 6:18 ` Alexandre Courbot [this message]
2026-06-16 23:48 ` [PATCH 3/5] gpu: nova-core: falcon: Move PFALCON2 register Antonin Malzieu Ridolfi via B4 Relay
2026-06-23 6:22 ` Alexandre Courbot
2026-06-16 23:48 ` [PATCH 4/5] gpu: nova-core: falcon: Move PRISCV register Antonin Malzieu Ridolfi via B4 Relay
2026-06-16 23:48 ` [PATCH 5/5] gpu: nova-core: falcon: Move PFSP register Antonin Malzieu Ridolfi via B4 Relay
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=DJG7LBVUQ0FA.2G12DPFA5RWQT@nvidia.com \
--to=acourbot@nvidia.com \
--cc=airlied@gmail.com \
--cc=aliceryhl@google.com \
--cc=dakr@kernel.org \
--cc=daniel.almeida@collabora.com \
--cc=dev@nanonej.com \
--cc=devnull+dev.nanonej.com@kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nova-gpu@lists.linux.dev \
--cc=simona@ffwll.ch \
/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