All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Alexandre Courbot" <acourbot@nvidia.com>
Cc: ojeda@kernel.org, "Danilo Krummrich" <dakr@kernel.org>,
	dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 2/4] gpu: nova-core: move GPU static information acquisition to a GSP method
Date: Tue, 09 Jun 2026 08:15:25 +0000	[thread overview]
Message-ID: <20260609081526.794C61F00893@smtp.kernel.org> (raw)
In-Reply-To: <20260609-boot-vram-v1-2-d9382610507a@nvidia.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Incorrect drop order in `Gpu` struct causes sysmem flush page to be unregistered before GSP falcons are reset, leading to driver timeouts or hardware faults.
--

commit 70dc6b2e19cb0af3250719038111e9c9fcddf6e7
Author: Alexandre Courbot <acourbot@nvidia.com>

gpu: nova-core: move GPU static information acquisition to a GSP method

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. This moves the code acquiring it to a dedicated method of
Gsp that can be called as soon as the Gsp is booted.

> diff --git a/drivers/gpu/nova-core/gpu.rs b/drivers/gpu/nova-core/gpu.rs
> index 6b3e02c71dee1..a0cb36cdeeead 100644
> --- a/drivers/gpu/nova-core/gpu.rs
> +++ b/drivers/gpu/nova-core/gpu.rs
[ ... ]
> @@ -290,6 +291,8 @@ pub(crate) struct Gpu<'gpu> {
>      /// GSP and its resources.
>      #[pin]
>      gsp_resources: GspResources<'gpu>,

[Severity: High]
Does this struct layout result in an incorrect drop order?

In Rust, struct fields are dropped in their declaration order. Since
sysmem_flush is declared before gsp_resources in the Gpu struct, it will be
dropped first.

When sysmem_flush drops, its Drop implementation unregisters the memory flush
page by writing 0 to the hardware registers. Immediately after, gsp_resources
drops, which shuts down the GSP and resets the falcons.

However, the sysmem flush memory page must be registered before any falcon is
reset, because the reset handshake requires system memory writes. Dropping the
flush page too early means the subsequent falcon reset handshake will write
to address 0 or hang, potentially causing a driver timeout or IOMMU fault.

It appears the unload logic was moved to the GspResources subobject in this
patch series without reordering the struct fields, which causes the reset to
run after the flush page is already unregistered.

> +    /// Static GPU information as provided by the GSP.
> +    gsp_static_info: GetGspStaticInfoReply,
>  }

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260609-boot-vram-v1-0-d9382610507a@nvidia.com?part=2

  reply	other threads:[~2026-06-09  8:15 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-09  8:03 [PATCH 0/4] gpu: nova-core: obtain and display VRAM amount Alexandre Courbot
2026-06-09  8:03 ` [PATCH 1/4] gpu: nova-core: move GSP unload state to a pinned Gpu subobject Alexandre Courbot
2026-06-09  8:16   ` sashiko-bot
2026-06-10  3:52   ` Eliot Courtney
2026-06-10 11:18     ` Alexandre Courbot
2026-06-10 12:30       ` Eliot Courtney
2026-06-10 10:14   ` Gary Guo
2026-06-10 11:21     ` Alexandre Courbot
2026-06-09  8:04 ` [PATCH 2/4] gpu: nova-core: move GPU static information acquisition to a GSP method Alexandre Courbot
2026-06-09  8:15   ` sashiko-bot [this message]
2026-06-10  3:39   ` Eliot Courtney
2026-06-10 10:16   ` Gary Guo
2026-06-09  8:04 ` [PATCH 3/4] gpu: nova-core: gsp: Extract usable FB region from GSP Alexandre Courbot
2026-06-10  3:35   ` Eliot Courtney
2026-06-10 10:23   ` Gary Guo
2026-06-10 10:27     ` Gary Guo
2026-06-10 15:38       ` Timur Tabi
2026-06-09  8:04 ` [PATCH 4/4] gpu: nova-core: gsp: Expose total physical VRAM end from FB region info Alexandre Courbot
2026-06-10  3:37   ` Eliot Courtney

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=20260609081526.794C61F00893@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=acourbot@nvidia.com \
    --cc=dakr@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=ojeda@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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.