public inbox for rust-for-linux@vger.kernel.org
 help / color / mirror / Atom feed
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>,
	 Joel Fernandes <joelagnelf@nvidia.com>,
	Timur Tabi <ttabi@nvidia.com>,  Edwin Peer <epeer@nvidia.com>,
	Eliot Courtney <ecourtney@nvidia.com>,
	 nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
	 linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org,
	 Alexandre Courbot <acourbot@nvidia.com>
Subject: [PATCH v2 10/10] gpu: nova-core: gsp: use available device reference
Date: Tue, 16 Dec 2025 13:27:30 +0900	[thread overview]
Message-ID: <20251216-nova-misc-v2-10-dc7b42586c04@nvidia.com> (raw)
In-Reply-To: <20251216-nova-misc-v2-0-dc7b42586c04@nvidia.com>

We already have a regular reference to the `Device`, so we don't need to
repeatedly acquire one in this method.

Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
---
 drivers/gpu/nova-core/gsp/boot.rs | 32 +++++++-------------------------
 1 file changed, 7 insertions(+), 25 deletions(-)

diff --git a/drivers/gpu/nova-core/gsp/boot.rs b/drivers/gpu/nova-core/gsp/boot.rs
index 54937606b5b0..ca7efdaa753b 100644
--- a/drivers/gpu/nova-core/gsp/boot.rs
+++ b/drivers/gpu/nova-core/gsp/boot.rs
@@ -173,15 +173,10 @@ pub(crate) fn boot(
             Some(libos_handle as u32),
             Some((libos_handle >> 32) as u32),
         )?;
-        dev_dbg!(
-            pdev.as_ref(),
-            "GSP MBOX0: {:#x}, MBOX1: {:#x}\n",
-            mbox0,
-            mbox1
-        );
+        dev_dbg!(dev, "GSP MBOX0: {:#x}, MBOX1: {:#x}\n", mbox0, mbox1);
 
         dev_dbg!(
-            pdev.as_ref(),
+            dev,
             "Using SEC2 to load and run the booter_load firmware...\n"
         );
 
@@ -193,19 +188,10 @@ pub(crate) fn boot(
             Some(wpr_handle as u32),
             Some((wpr_handle >> 32) as u32),
         )?;
-        dev_dbg!(
-            pdev.as_ref(),
-            "SEC2 MBOX0: {:#x}, MBOX1{:#x}\n",
-            mbox0,
-            mbox1
-        );
+        dev_dbg!(dev, "SEC2 MBOX0: {:#x}, MBOX1{:#x}\n", mbox0, mbox1);
 
         if mbox0 != 0 {
-            dev_err!(
-                pdev.as_ref(),
-                "Booter-load failed with error {:#x}\n",
-                mbox0
-            );
+            dev_err!(dev, "Booter-load failed with error {:#x}\n", mbox0);
             return Err(ENODEV);
         }
 
@@ -219,11 +205,7 @@ pub(crate) fn boot(
             Delta::from_secs(5),
         )?;
 
-        dev_dbg!(
-            pdev.as_ref(),
-            "RISC-V active? {}\n",
-            gsp_falcon.is_riscv_active(bar),
-        );
+        dev_dbg!(dev, "RISC-V active? {}\n", gsp_falcon.is_riscv_active(bar),);
 
         // Create and run the GSP sequencer.
         let seq_params = GspSequencerParams {
@@ -231,7 +213,7 @@ pub(crate) fn boot(
             libos_dma_handle: libos_handle,
             gsp_falcon,
             sec2_falcon,
-            dev: pdev.as_ref().into(),
+            dev: dev.into(),
             bar,
         };
         GspSequencer::run(&mut self.cmdq, seq_params)?;
@@ -242,7 +224,7 @@ pub(crate) fn boot(
         // Obtain and display basic GPU information.
         let info = commands::get_gsp_info(&mut self.cmdq, bar)?;
         dev_info!(
-            pdev.as_ref(),
+            dev,
             "GPU name: {}\n",
             info.gpu_name().unwrap_or("invalid GPU name")
         );

-- 
2.52.0


  parent reply	other threads:[~2025-12-16  4:28 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-16  4:27 [PATCH v2 00/10] gpu: nova-core: miscellaneous improvements Alexandre Courbot
2025-12-16  4:27 ` [PATCH v2 01/10] gpu: nova-core: gsp: warn if data remains after processing a message Alexandre Courbot
2026-01-19 15:33   ` Gary Guo
2025-12-16  4:27 ` [PATCH v2 02/10] gpu: nova-core: gsp: remove unnecessary Display impls Alexandre Courbot
2026-01-19 15:41   ` Gary Guo
2025-12-16  4:27 ` [PATCH v2 03/10] gpu: nova-core: gsp: simplify sequencer opcode parsing Alexandre Courbot
2026-01-19 16:11   ` Gary Guo
2025-12-16  4:27 ` [PATCH v2 04/10] gpu: nova-core: gsp: remove unneeded sequencer trait Alexandre Courbot
2026-01-19 16:12   ` Gary Guo
2025-12-16  4:27 ` [PATCH v2 05/10] gpu: nova-core: gsp: derive `Debug` on more sequencer types Alexandre Courbot
2026-01-19 16:12   ` Gary Guo
2025-12-16  4:27 ` [PATCH v2 06/10] gpu: nova-core: gsp: derive Zeroable for GspStaticConfigInfo Alexandre Courbot
2026-01-19 16:16   ` Gary Guo
2025-12-16  4:27 ` [PATCH v2 07/10] gpu: nova-core: firmware: fwsec: do not require bound device when unneeded Alexandre Courbot
2026-01-19 15:50   ` Danilo Krummrich
2025-12-16  4:27 ` [PATCH v2 08/10] gpu: nova-core: use core library's CStr instead of kernel one Alexandre Courbot
2026-01-19 16:17   ` Gary Guo
2025-12-16  4:27 ` [PATCH v2 09/10] gpu: nova-core: simplify str_from_null_terminated Alexandre Courbot
2026-01-03  3:37   ` John Hubbard
2026-01-03 10:14     ` Danilo Krummrich
2026-01-14 13:43       ` Alexandre Courbot
2025-12-16  4:27 ` Alexandre Courbot [this message]
2026-01-19 16:18   ` [PATCH v2 10/10] gpu: nova-core: gsp: use available device reference Gary Guo

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=20251216-nova-misc-v2-10-dc7b42586c04@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=epeer@nvidia.com \
    --cc=jhubbard@nvidia.com \
    --cc=joelagnelf@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nouveau@lists.freedesktop.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