Re: [PATCH 2/4] gpu: nova-core: move GPU static information acquisition to a GSP method
From: Gary Guo
Date: Wed Jun 10 2026 - 06:18:26 EST
On Tue Jun 9, 2026 at 9:04 AM BST, Alexandre Courbot wrote:
> The GSP static information is useful during regular driver runtime;
> however it is currently obtained from `Gsp::boot`, with no elegant way
> to pass it back to the caller.
>
> Solve this by moving the code acquiring it to a dedicated method of
> `Gsp` that can be called as soon as the `Gsp` is booted. This allows us
> to obtain and display the static information from the `Gpu` constructor,
> and to store the static information for later use.
>
> Its location at the end of `Gsp::boot` was a bit out-of-place anyway:
> technically, the GSP is considered booted after we have received the
> `GspInitDone` message, so anything that happens afterwards is not part
> of the boot sequence anymore.
>
> Signed-off-by: Alexandre Courbot <acourbot@xxxxxxxxxx>
> ---
> drivers/gpu/nova-core/gpu.rs | 16 ++++++++++++++++
> drivers/gpu/nova-core/gsp.rs | 15 +++++++++++----
> drivers/gpu/nova-core/gsp/boot.rs | 7 -------
> 3 files changed, 27 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/gpu/nova-core/gpu.rs b/drivers/gpu/nova-core/gpu.rs
> index 6b3e02c71dee..a0cb36cdeeea 100644
> --- a/drivers/gpu/nova-core/gpu.rs
> +++ b/drivers/gpu/nova-core/gpu.rs
> @@ -23,6 +23,7 @@
> fb::SysmemFlush,
> gsp::{
> self,
> + commands::GetGspStaticInfoReply,
> Gsp, //
> },
> regs,
> @@ -290,6 +291,8 @@ pub(crate) struct Gpu<'gpu> {
> /// GSP and its resources.
> #[pin]
> gsp_resources: GspResources<'gpu>,
> + /// Static GPU information as provided by the GSP.
> + gsp_static_info: GetGspStaticInfoReply,
> }
>
> #[pinned_drop]
> @@ -354,6 +357,19 @@ pub(crate) fn new(
> // is properly run in case of failure.
> unload_bundle: gsp.boot(pdev, bar, spec.chipset, gsp_falcon, sec2_falcon)?,
> }),
> +
> + gsp_static_info: {
> + let gsp = &gsp_resources.as_ref().get_ref().gsp;
What's this `as_ref().get_ref()` for? This could just be referenced as
`&gsp_resoruces.gsp`? Or am I missing something?
Best,
Gary
> +
> + // Obtain and display basic GPU information.
> + let info = gsp.get_static_info(bar)?;
> + match info.gpu_name() {
> + Ok(name) => dev_info!(pdev, "GPU name: {}\n", name),
> + Err(e) => dev_warn!(pdev, "GPU name unavailable: {:?}\n", e),
> + }
> +
> + info
> + }
> })
> }
> }