From: Alexandre Courbot <acourbot@nvidia.com>
To: Danilo Krummrich <dakr@kernel.org>,
Alice Ryhl <aliceryhl@google.com>,
David Airlie <airlied@gmail.com>,
Simona Vetter <simona@ffwll.ch>
Cc: John Hubbard <jhubbard@nvidia.com>,
Alistair Popple <apopple@nvidia.com>,
Timur Tabi <ttabi@nvidia.com>,
Eliot Courtney <ecourtney@nvidia.com>,
Zhi Wang <zhiw@nvidia.com>,
nova-gpu@lists.linux.dev, dri-devel@lists.freedesktop.org,
linux-kernel@vger.kernel.org,
Alexandre Courbot <acourbot@nvidia.com>
Subject: [PATCH 3/4] gpu: nova-core: gsp: return the static GPU configuration from boot
Date: Fri, 27 Nov 2026 23:04:07 +0900 [thread overview]
Message-ID: <20261127-nova-r000-staging-v1-3-4eaf6e3c0942@nvidia.com> (raw)
In-Reply-To: <20261127-nova-r000-staging-v1-0-4eaf6e3c0942@nvidia.com>
From: John Hubbard <jhubbard@nvidia.com>
With the r000 firmware, GSP-RM reports the static GPU configuration in
its reply to the GSP_INIT command that ends the boot, so the boot
sequence holds the configuration when it returns.
Nova-core fetches the configuration with an RPC command after the boot,
once the interrupt handler is registered. On r000, the boot sequence
would have to keep the GSP_INIT reply for that later step to read.
Return the configuration from the boot sequence, together with the
unload bundle, and send the RPC command at the end of the boot sequence
instead.
Signed-off-by: John Hubbard <jhubbard@nvidia.com>
Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
---
drivers/gpu/nova-core/api.rs | 2 +-
drivers/gpu/nova-core/gpu.rs | 36 +++++++++++++++++++-----------------
drivers/gpu/nova-core/gsp.rs | 13 ++++++++-----
drivers/gpu/nova-core/gsp/boot.rs | 15 +++++++++++----
4 files changed, 39 insertions(+), 27 deletions(-)
diff --git a/drivers/gpu/nova-core/api.rs b/drivers/gpu/nova-core/api.rs
index f800ba6c4183..a665eabc44c2 100644
--- a/drivers/gpu/nova-core/api.rs
+++ b/drivers/gpu/nova-core/api.rs
@@ -41,7 +41,7 @@ pub fn of(adev: &auxiliary::Device<Bound>) -> Result<NovaCoreApiHandle<'_>> {
/// Returns the GPU [`GspStaticInfo`].
pub fn gsp_static_info(&self) -> &GspStaticInfo {
- &self.gpu.gsp_static_info
+ self.gpu.gsp_static_info()
}
/// Returns the GPU [`Spec`].
diff --git a/drivers/gpu/nova-core/gpu.rs b/drivers/gpu/nova-core/gpu.rs
index 590d81f4e479..e4db5ce47316 100644
--- a/drivers/gpu/nova-core/gpu.rs
+++ b/drivers/gpu/nova-core/gpu.rs
@@ -32,7 +32,6 @@
gsp::{
self,
cmdq::Cmdq,
- commands::GspStaticInfo,
Gsp,
GspBootContext, //
},
@@ -341,8 +340,8 @@ struct GspResources<'gpu> {
/// GSP runtime data.
#[pin]
gsp: Gsp<'gpu>,
- /// GSP unload firmware bundle, if any.
- unload_bundle: Option<gsp::UnloadBundle<'gpu>>,
+ /// The static GPU configuration and the unload bundle that the boot sequence returned.
+ boot_result: gsp::BootResult<'gpu>,
}
/// The GSP event handler's registration and the enable of its subtree at `TOP`.
@@ -393,8 +392,6 @@ pub(crate) struct Gpu<'gpu> {
#[pin]
#[uses('tree)]
_gsp_subtree: GspSubtree<'gsp_resources>,
- /// Static GPU information as provided by the GSP.
- pub(crate) gsp_static_info: GspStaticInfo,
/// GPU memory manager owning memory management resources.
///
/// Must be kept declared *before* `gsp_resources`, so that its components are dropped while
@@ -425,7 +422,7 @@ fn drop(self: Pin<&mut Self>) {
let this = self.project();
let device = *this.device;
let bar = *this.bar;
- let bundle = this.unload_bundle.take();
+ let bundle = this.boot_result.unload_bundle.take();
let _ = this
.gsp
@@ -505,7 +502,7 @@ pub(crate) fn new<'a>(
// This member must be initialized last, so the `UnloadBundle` can never be dropped
// from outside of the constructed `GspResources`, ensuring that the unload sequence
// is properly run in case of failure.
- unload_bundle: gsp.boot(GspBootContext {
+ boot_result: gsp.boot(GspBootContext {
pdev,
bar,
chipset: spec.chipset,
@@ -537,9 +534,9 @@ pub(crate) fn new<'a>(
gsp_resources.gsp.cmdq.drain()?;
},
- gsp_static_info: {
+ _: {
// Obtain and display basic GPU information.
- let info = gsp_resources.gsp.get_static_info()?;
+ let info = &gsp_resources.boot_result.static_info;
match info.gpu_name() {
Ok(name) => dev_info!(dev, "GPU name: {}\n", name),
Err(e) => dev_warn!(dev, "GPU name unavailable: {:?}\n", e),
@@ -557,13 +554,12 @@ pub(crate) fn new<'a>(
info.vram_size() / u64::SZ_1M
);
}
-
- info
},
// Create GPU memory manager owning memory management resources.
mm: {
- let usable_vram = gsp_static_info.usable_fb_regions.first().ok_or(ENODEV)?;
+ let info = &gsp_resources.boot_result.static_info;
+ let usable_vram = info.usable_fb_regions.first().ok_or(ENODEV)?;
let buddy_params = GpuBuddyParams {
base_offset: usable_vram.start,
size: usable_vram.end - usable_vram.start,
@@ -574,13 +570,14 @@ pub(crate) fn new<'a>(
bar,
gsp_resources.spec.chipset,
buddy_params,
- VramAddress::from_raw(gsp_static_info.total_fb_end),
+ VramAddress::from_raw(info.total_fb_end),
)?
},
// Create BAR1 user interface for CPU access to GPU virtual memory.
bar_user <- {
- let pdb_addr = VramAddress::from_raw(gsp_static_info.bar1_pde_base);
+ let info = &gsp_resources.boot_result.static_info;
+ let pdb_addr = VramAddress::from_raw(info.bar1_pde_base);
let bar1_idx = crate::driver::bar1_resource_index(pdev)?;
let bar1_size = pdev.resource_len(bar1_idx)?;
@@ -594,6 +591,11 @@ pub(crate) fn new<'a>(
})
}
+ /// Returns the static GPU configuration that GSP-RM reported at boot.
+ pub(crate) fn gsp_static_info(&self) -> &gsp::commands::GspStaticInfo {
+ &self.gsp_resources.boot_result.static_info
+ }
+
/// Waits for GFW, the GPU's boot firmware, to report completion.
///
/// The driver must not program the GPU before then.
@@ -616,14 +618,14 @@ pub(crate) fn wait_gfw_boot_completion(
pub(crate) fn run_selftests(self: Pin<&mut Self>, pdev: &pci::Device<device::Bound>) {
let this = self.project();
let dev = pdev.as_ref();
- let regions = &this.gsp_static_info.usable_fb_regions;
+ let info = &this.gsp_resources.boot_result.static_info;
if let Err(err) = crate::mm::selftest::run(
dev,
this.mm,
- regions,
+ &info.usable_fb_regions,
&this.bar_user,
- this.gsp_static_info.bar1_pde_base,
+ info.bar1_pde_base,
this.spec.chipset,
) {
dev_err!(dev, "self-tests failed: {:?}\n", err);
diff --git a/drivers/gpu/nova-core/gsp.rs b/drivers/gpu/nova-core/gsp.rs
index 398d6525b133..bf0028e52e3c 100644
--- a/drivers/gpu/nova-core/gsp.rs
+++ b/drivers/gpu/nova-core/gsp.rs
@@ -157,12 +157,15 @@ pub(crate) fn new(
}))
})
}
-
- /// Query the GSP for the static GPU information.
- pub(crate) fn get_static_info(&self) -> Result<commands::GspStaticInfo> {
- self.cmdq.send_rpc_command(commands::rpc::GetGspStaticInfo)
- }
}
/// Opaque bundle required to unload the GSP. Created by [`Gsp::boot`], consumed by [`Gsp::unload`].
pub(crate) struct UnloadBundle<'a>(KBox<dyn hal::UnloadBundle + 'a>);
+
+/// The output of [`Gsp::boot`]: the static GPU configuration and the unload bundle.
+pub(crate) struct BootResult<'a> {
+ /// The unload bundle for [`Gsp::unload`], if one could be built.
+ pub(crate) unload_bundle: Option<UnloadBundle<'a>>,
+ /// The static GPU configuration as reported by GSP-RM.
+ pub(crate) static_info: commands::GspStaticInfo,
+}
diff --git a/drivers/gpu/nova-core/gsp/boot.rs b/drivers/gpu/nova-core/gsp/boot.rs
index 9d5da5b165ac..a45f2b21a2ab 100644
--- a/drivers/gpu/nova-core/gsp/boot.rs
+++ b/drivers/gpu/nova-core/gsp/boot.rs
@@ -27,12 +27,12 @@ impl<'gsp> super::Gsp<'gsp> {
/// user-space, patching them with signatures, and building firmware-specific intricate data
/// structures that the GSP will use at runtime.
///
- /// Upon return, the GSP is up and running, and its unload bundle (to be given as argument to
- /// [`Self::unload`]) returned.
+ /// Returns, with the GSP running, the static configuration that GSP-RM reported and the
+ /// unload bundle for [`Self::unload`].
pub(crate) fn boot(
self: Pin<&mut Self>,
mut ctx: super::GspBootContext<'_, 'gsp>,
- ) -> Result<Option<super::UnloadBundle<'gsp>>> {
+ ) -> Result<super::BootResult<'gsp>> {
let pdev = ctx.pdev;
let chipset = ctx.chipset;
let gsp_falcon = ctx.gsp_falcon;
@@ -84,7 +84,14 @@ pub(crate) fn boot(
// Wait until GSP is fully initialized.
commands::rpc::wait_gsp_init_done(&self.cmdq)?;
- Ok(unload_guard.dismiss().1)
+ let static_info = self
+ .cmdq
+ .send_rpc_command(commands::rpc::GetGspStaticInfo)?;
+
+ Ok(super::BootResult {
+ unload_bundle: unload_guard.dismiss().1,
+ static_info,
+ })
}
/// Shut down the GSP and wait until it is offline.
--
2.56.1
next prev parent reply other threads:[~2026-11-27 14:04 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-27 14:04 [PATCH 0/4] gpu: nova-core: gsp: preparatory patches for the r000 firmware Alexandre Courbot
2026-11-27 14:04 ` [PATCH 1/4] gpu: nova-core: gsp: add the r000 queue element header Alexandre Courbot
2026-11-27 14:52 ` Gary Guo
2026-11-27 14:04 ` [PATCH 2/4] gpu: nova-core: gsp: rename and move the static configuration type Alexandre Courbot
2026-11-27 14:04 ` Alexandre Courbot [this message]
2026-11-27 14:04 ` [PATCH 4/4] gpu: nova-core: gsp: add the short name and GID to the GSP_INIT reply 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=20261127-nova-r000-staging-v1-3-4eaf6e3c0942@nvidia.com \
--to=acourbot@nvidia.com \
--cc=airlied@gmail.com \
--cc=aliceryhl@google.com \
--cc=apopple@nvidia.com \
--cc=dakr@kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=ecourtney@nvidia.com \
--cc=jhubbard@nvidia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=nova-gpu@lists.linux.dev \
--cc=simona@ffwll.ch \
--cc=ttabi@nvidia.com \
--cc=zhiw@nvidia.com \
/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
all inboxes | Powered by JetHome®