public inbox for drm-ai-reviews@public-inbox.freedesktop.org
 help / color / mirror / Atom feed
From: Eliot Courtney <ecourtney@nvidia.com>
To: Danilo Krummrich <dakr@kernel.org>,
	Alexandre Courbot <acourbot@nvidia.com>,
	Alice Ryhl <aliceryhl@google.com>,
	David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
	John Hubbard <jhubbard@nvidia.com>, Gary Guo <gary@garyguo.net>
Cc: Alistair Popple <apopple@nvidia.com>,
	Joel Fernandes <joelagnelf@nvidia.com>,
	Timur Tabi <ttabi@nvidia.com>,
	rust-for-linux@vger.kernel.org, dri-devel@lists.freedesktop.org,
	linux-kernel@vger.kernel.org,
	Eliot Courtney <ecourtney@nvidia.com>
Subject: [PATCH 2/3] gpu: nova-core: add Architecture::uses_sec2() helper
Date: Thu, 09 Apr 2026 23:19:40 +0900	[thread overview]
Message-ID: <20260409-b4-blackwell-unload-v1-2-0f5a2ff838dd@nvidia.com> (raw)
In-Reply-To: <20260409-b4-blackwell-unload-v1-0-0f5a2ff838dd@nvidia.com>

This will be used in the following patch as common logic.

Signed-off-by: Eliot Courtney <ecourtney@nvidia.com>
---
 drivers/gpu/nova-core/gpu.rs      | 7 +++++++
 drivers/gpu/nova-core/gsp/boot.rs | 5 +----
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/nova-core/gpu.rs b/drivers/gpu/nova-core/gpu.rs
index 2bcaa7bc5125..674dc286162a 100644
--- a/drivers/gpu/nova-core/gpu.rs
+++ b/drivers/gpu/nova-core/gpu.rs
@@ -180,6 +180,13 @@ pub(crate) enum Architecture with TryFrom<Bounded<u32, 6>> {
 }
 
 impl Architecture {
+    /// Returns `true` if this architecture uses SEC2 to boot GSP.
+    ///
+    /// Turing/Ampere/Ada use FWSEC + SEC2 booter firmware. Hopper and later use FSP instead.
+    pub(crate) const fn uses_sec2(&self) -> bool {
+        matches!(self, Self::Turing | Self::Ampere | Self::Ada)
+    }
+
     /// Returns the DMA mask supported by this architecture.
     pub(crate) const fn dma_mask(&self) -> DmaMask {
         match self {
diff --git a/drivers/gpu/nova-core/gsp/boot.rs b/drivers/gpu/nova-core/gsp/boot.rs
index e6d8b848ec46..1aac634c3b67 100644
--- a/drivers/gpu/nova-core/gsp/boot.rs
+++ b/drivers/gpu/nova-core/gsp/boot.rs
@@ -332,10 +332,7 @@ pub(crate) fn boot(
         sec2_falcon: &Falcon<Sec2>,
     ) -> Result {
         let dev = pdev.as_ref();
-        let uses_sec2 = matches!(
-            chipset.arch(),
-            Architecture::Turing | Architecture::Ampere | Architecture::Ada
-        );
+        let uses_sec2 = chipset.arch().uses_sec2();
 
         let gsp_fw = KBox::pin_init(GspFirmware::new(dev, chipset, FIRMWARE_VERSION), GFP_KERNEL)?;
 

-- 
2.53.0


  parent reply	other threads:[~2026-04-09 14:20 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-09 14:19 [PATCH 0/3] gpu: nova-core: unload extras for Hopper/Blackwell Eliot Courtney
2026-04-09 14:19 ` [PATCH 1/3] gpu: nova-core: fsp: wait to consume message before sending another Eliot Courtney
2026-04-12  1:19   ` Claude review: " Claude Code Review Bot
2026-04-09 14:19 ` Eliot Courtney [this message]
2026-04-12  1:19   ` Claude review: gpu: nova-core: add Architecture::uses_sec2() helper Claude Code Review Bot
2026-04-09 14:19 ` [PATCH 3/3] gpu: nova-core: add non-sec2 unload path Eliot Courtney
2026-04-12  1:19   ` Claude review: " Claude Code Review Bot
2026-04-12  1:19 ` Claude review: gpu: nova-core: unload extras for Hopper/Blackwell Claude Code Review Bot

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=20260409-b4-blackwell-unload-v1-2-0f5a2ff838dd@nvidia.com \
    --to=ecourtney@nvidia.com \
    --cc=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=gary@garyguo.net \
    --cc=jhubbard@nvidia.com \
    --cc=joelagnelf@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=simona@ffwll.ch \
    --cc=ttabi@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