mirror of https://lore.kernel.org/lkml/
 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>,
	"Miguel Ojeda" <ojeda@kernel.org>,
	"Boqun Feng" <boqun@kernel.org>, "Gary Guo" <gary@garyguo.net>,
	"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
	"Benno Lossin" <lossin@kernel.org>,
	"Andreas Hindborg" <a.hindborg@kernel.org>,
	"Trevor Gross" <tmgross@umich.edu>,
	"Daniel Almeida" <daniel.almeida@collabora.com>,
	"Tamir Duberstein" <tamird@kernel.org>,
	"Onur Özkan" <work@onurozkan.dev>,
	"Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
	"Maxime Ripard" <mripard@kernel.org>,
	"Thomas Zimmermann" <tzimmermann@suse.de>,
	"Jonathan Corbet" <corbet@lwn.net>,
	"Shuah Khan" <skhan@linuxfoundation.org>,
	"Randy Dunlap" <rdunlap@infradead.org>
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>,  Alok Kumar <alkumar@nvidia.com>,
	nova-gpu@lists.linux.dev,  dri-devel@lists.freedesktop.org,
	rust-for-linux@vger.kernel.org,  linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	 Alexandre Courbot <acourbot@nvidia.com>
Subject: [PATCH 04/15] gpu: nova-core: gsp: re-export PowerStateLevel from gsp::commands
Date: Thu, 03 Dec 2026 21:09:21 +0900	[thread overview]
Message-ID: <20261203-b4-r000-switch-v1-4-b1463ec6dae2@nvidia.com> (raw)
In-Reply-To: <20261203-b4-r000-switch-v1-0-b1463ec6dae2@nvidia.com>

PowerStateLevel is currently re-exported from gsp::commands::rpc, while
the upcoming GSP_SUSPEND GMC command will take it as well.

Re-export PowerStateLevel from gsp::commands alongside GspStaticInfo so
both command protocols and their callers can share it.

No functional change.

Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
---
 drivers/gpu/nova-core/gsp/boot.rs         | 15 +++++++--------
 drivers/gpu/nova-core/gsp/commands.rs     |  2 ++
 drivers/gpu/nova-core/gsp/commands/rpc.rs |  7 ++++---
 3 files changed, 13 insertions(+), 11 deletions(-)

diff --git a/drivers/gpu/nova-core/gsp/boot.rs b/drivers/gpu/nova-core/gsp/boot.rs
index 09ad11ac74cb..2904f1ac7459 100644
--- a/drivers/gpu/nova-core/gsp/boot.rs
+++ b/drivers/gpu/nova-core/gsp/boot.rs
@@ -16,7 +16,10 @@
     firmware::gsp::GspFirmware,
     gsp::{
         cmdq::Cmdq,
-        commands, //
+        commands::{
+            self,
+            PowerStateLevel, //
+        },
     },
 };
 
@@ -98,7 +101,7 @@ pub(crate) fn boot(
     fn shutdown_gsp(
         cmdq: &Cmdq<'_>,
         gsp_falcon: &Falcon<'_, Gsp>,
-        mode: commands::rpc::PowerStateLevel,
+        mode: PowerStateLevel,
     ) -> Result {
         // Command to shut the GSP down.
         cmdq.send_rpc_command(commands::rpc::UnloadingGuestDriver::new(mode))?;
@@ -118,12 +121,8 @@ pub(crate) fn unload(
         let dev = ctx.dev();
 
         // Shut down the GSP. Keep going even in case of error.
-        let mut res = Self::shutdown_gsp(
-            &self.cmdq,
-            ctx.gsp_falcon,
-            commands::rpc::PowerStateLevel::Level0,
-        )
-        .inspect_err(|e| dev_err!(dev, "GSP shutdown failed: {:?}\n", e));
+        let mut res = Self::shutdown_gsp(&self.cmdq, ctx.gsp_falcon, PowerStateLevel::Level0)
+            .inspect_err(|e| dev_err!(dev, "GSP shutdown failed: {:?}\n", e));
 
         // Run the unload bundle to reset the GSP so it can be booted again.
         if let Some(unload_bundle) = unload_bundle {
diff --git a/drivers/gpu/nova-core/gsp/commands.rs b/drivers/gpu/nova-core/gsp/commands.rs
index b48cf30978cf..4ffcb4133e02 100644
--- a/drivers/gpu/nova-core/gsp/commands.rs
+++ b/drivers/gpu/nova-core/gsp/commands.rs
@@ -14,6 +14,8 @@
 
 use kernel::prelude::*;
 
+pub(crate) use crate::gsp::fw::commands::PowerStateLevel;
+
 /// The static GPU configuration, which GSP-RM reports in reply to
 /// [`GetGspStaticInfo`](rpc::GetGspStaticInfo).
 pub struct GspStaticInfo {
diff --git a/drivers/gpu/nova-core/gsp/commands/rpc.rs b/drivers/gpu/nova-core/gsp/commands/rpc.rs
index ab6d1114cead..084214d69f1f 100644
--- a/drivers/gpu/nova-core/gsp/commands/rpc.rs
+++ b/drivers/gpu/nova-core/gsp/commands/rpc.rs
@@ -27,7 +27,10 @@
             Cmdq,
             NoReply, //
         },
-        commands::GspStaticInfo,
+        commands::{
+            GspStaticInfo,
+            PowerStateLevel, //
+        },
         fw::{
             self,
             MsgFunction, //
@@ -240,8 +243,6 @@ fn read(
     }
 }
 
-pub(crate) use fw::commands::PowerStateLevel;
-
 /// The `UnloadingGuestDriver` command, used to shut down the GSP.
 ///
 /// Only used within the `gsp` module.

-- 
2.56.1


  parent reply	other threads:[~2026-12-03 12:09 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-03 12:09 [PATCH 00/15] gpu: nova-core: switch to the r000 GSP firmware Alexandre Courbot
2026-12-03 12:09 ` [PATCH 01/15] gpu: nova-core: gsp: nvkv: add const constructor for Key Alexandre Courbot
2026-12-03 12:09 ` [PATCH 02/15] gpu: nova-core: gsp: add the GSP_INIT command and its reply Alexandre Courbot
2026-12-03 12:09 ` [PATCH 03/15] gpu: nova-core: gsp: populate VF information in GSP_INIT Alexandre Courbot
2026-12-03 14:03   ` Maxime Ripard
2026-12-03 12:09 ` Alexandre Courbot [this message]
2026-12-03 12:09 ` [PATCH 05/15] gpu: nova-core: gsp: add the GSP_SUSPEND request Alexandre Courbot
2026-12-03 12:09 ` [PATCH 06/15] gpu: nova-core: firmware: add the ucodes firmware loader Alexandre Courbot
2026-12-03 12:09 ` [PATCH 07/15] gpu: nova-core: gsp: define GSP_MSG_QUEUE_ELEMENT_SIZE_MAX without bindings Alexandre Courbot
2026-12-03 12:09 ` [PATCH 08/15] gpu: nova-core: fb: increase Blackwell reserved memory sizes for r000 Alexandre Courbot
2026-12-03 12:09 ` [PATCH 09/15] gpu: nova-core: gsp: drain the message queue while waiting for GSP suspend Alexandre Courbot
2026-12-03 12:09 ` [PATCH 10/15] gpu: nova-core: gsp: zero-initialize FMC boot parameter structs Alexandre Courbot
2026-12-03 12:09 ` [PATCH 11/15] gpu: nova-core: firmware: add r000 GSP bindings Alexandre Courbot
2026-12-03 12:09 ` [PATCH 12/15] gpu: nova-core: switch to the r000 GSP firmware Alexandre Courbot
2026-12-03 12:09 ` [PATCH 13/15] gpu: nova-core: gsp: delete the GSP sequencer Alexandre Courbot
2026-12-03 12:09 ` [PATCH 14/15] gpu: nova-core: gsp: delete the r570 RPC commands Alexandre Courbot
2026-12-03 12:09 ` [PATCH 15/15] gpu: nova-core: firmware: delete the r570 bindings 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=20261203-b4-r000-switch-v1-4-b1463ec6dae2@nvidia.com \
    --to=acourbot@nvidia.com \
    --cc=a.hindborg@kernel.org \
    --cc=airlied@gmail.com \
    --cc=aliceryhl@google.com \
    --cc=alkumar@nvidia.com \
    --cc=apopple@nvidia.com \
    --cc=bjorn3_gh@protonmail.com \
    --cc=boqun@kernel.org \
    --cc=corbet@lwn.net \
    --cc=dakr@kernel.org \
    --cc=daniel.almeida@collabora.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=ecourtney@nvidia.com \
    --cc=gary@garyguo.net \
    --cc=jhubbard@nvidia.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lossin@kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=nova-gpu@lists.linux.dev \
    --cc=ojeda@kernel.org \
    --cc=rdunlap@infradead.org \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=simona@ffwll.ch \
    --cc=skhan@linuxfoundation.org \
    --cc=tamird@kernel.org \
    --cc=tmgross@umich.edu \
    --cc=ttabi@nvidia.com \
    --cc=tzimmermann@suse.de \
    --cc=work@onurozkan.dev \
    --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®