From: Eliot Courtney <ecourtney@nvidia.com>
To: Danilo Krummrich <dakr@kernel.org>,
Alice Ryhl <aliceryhl@google.com>,
Alexandre Courbot <acourbot@nvidia.com>,
David Airlie <airlied@gmail.com>,
Simona Vetter <simona@ffwll.ch>
Cc: John Hubbard <jhubbard@nvidia.com>,
Alistair Popple <apopple@nvidia.com>,
Timur Tabi <ttabi@nvidia.com>, Zhi Wang <zhiw@nvidia.com>,
nova-gpu@lists.linux.dev, dri-devel@lists.freedesktop.org,
linux-kernel@vger.kernel.org,
Eliot Courtney <ecourtney@nvidia.com>
Subject: [PATCH v2 1/7] gpu: nova-core: falcon: factor out the wait for the GSP suspend
Date: Wed, 02 Dec 2026 21:06:33 +0900 [thread overview]
Message-ID: <20261202-falcon-v2-1-33ed73a20796@nvidia.com> (raw)
In-Reply-To: <20261202-falcon-v2-0-33ed73a20796@nvidia.com>
From: John Hubbard <jhubbard@nvidia.com>
The r000 boot protocol requires the driver to wait for the GSP suspend
bit after each load-and-execute event, as the shutdown path already
does.
In order to make the wait available to the boot sequence, factor it out
of the shutdown path, into a method of the GSP falcon.
No functional changes.
Signed-off-by: John Hubbard <jhubbard@nvidia.com>
Reviewed-by: Eliot Courtney <ecourtney@nvidia.com>
Reviewed-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Eliot Courtney <ecourtney@nvidia.com>
---
drivers/gpu/nova-core/falcon/gsp.rs | 15 +++++++++++++++
drivers/gpu/nova-core/gsp/boot.rs | 8 +-------
2 files changed, 16 insertions(+), 7 deletions(-)
diff --git a/drivers/gpu/nova-core/falcon/gsp.rs b/drivers/gpu/nova-core/falcon/gsp.rs
index 54247691b53c..2ea28fa53db8 100644
--- a/drivers/gpu/nova-core/falcon/gsp.rs
+++ b/drivers/gpu/nova-core/falcon/gsp.rs
@@ -54,6 +54,21 @@ pub(crate) fn is_processor_suspended(&self) -> bool {
.processor_suspended()
}
+ /// Waits until GSP-RM has suspended the RISC-V core.
+ ///
+ /// # Errors
+ ///
+ /// - `ETIMEDOUT` if the core has not suspended within five seconds.
+ pub(crate) fn wait_for_processor_suspend(&self) -> Result {
+ read_poll_timeout(
+ || Ok(self.is_processor_suspended()),
+ |suspended| *suspended,
+ Delta::from_millis(10),
+ Delta::from_secs(5),
+ )
+ .map(|_| ())
+ }
+
/// Clears the SWGEN0 latch in the GSP falcon.
///
/// While the latch is set, no later message signals the tree, so a caller that consumed a
diff --git a/drivers/gpu/nova-core/gsp/boot.rs b/drivers/gpu/nova-core/gsp/boot.rs
index a45f2b21a2ab..09ad11ac74cb 100644
--- a/drivers/gpu/nova-core/gsp/boot.rs
+++ b/drivers/gpu/nova-core/gsp/boot.rs
@@ -104,13 +104,7 @@ fn shutdown_gsp(
cmdq.send_rpc_command(commands::rpc::UnloadingGuestDriver::new(mode))?;
// Wait until GSP signals it is suspended.
- read_poll_timeout(
- || Ok(gsp_falcon.is_processor_suspended()),
- |suspended| *suspended,
- Delta::from_millis(10),
- Delta::from_secs(5),
- )
- .map(|_| ())
+ gsp_falcon.wait_for_processor_suspend()
}
/// Attempts to unload the GSP firmware.
--
2.56.1
next prev parent reply other threads:[~2026-12-02 12:07 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-02 12:06 [PATCH v2 0/7] gpu: nova-core: gsp: add r000 load+exec handlers Eliot Courtney
2026-12-02 12:06 ` Eliot Courtney [this message]
2026-12-02 12:06 ` [PATCH v2 2/7] gpu: nova-core: gsp: factor out the core resume Eliot Courtney
2026-12-02 12:06 ` [PATCH v2 3/7] gpu: nova-core: gsp: fix resume_gsp_rm()'s error messages Eliot Courtney
2026-12-02 12:06 ` [PATCH v2 4/7] gpu: nova-core: falcon: select the BAR2 engine ID for DMA transfers Eliot Courtney
2026-12-03 10:40 ` Alexandre Courbot
2026-12-02 12:06 ` [PATCH v2 5/7] gpu: nova-core: gsp: add the r000 load-and-execute HS binary handler Eliot Courtney
2026-12-03 10:40 ` Alexandre Courbot
2026-12-02 12:06 ` [PATCH v2 6/7] gpu: nova-core: gsp: add the r000 load-and-execute bootloader handler Eliot Courtney
2026-12-03 10:40 ` Alexandre Courbot
2026-12-02 12:06 ` [PATCH v2 7/7] gpu: nova-core: gsp: add the load-and-execute event dispatcher Eliot Courtney
2026-12-03 10:40 ` Alexandre Courbot
2026-12-03 10:45 ` [PATCH v2 0/7] gpu: nova-core: gsp: add r000 load+exec handlers 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=20261202-falcon-v2-1-33ed73a20796@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=jhubbard@nvidia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=nova-gpu@lists.linux.dev \
--cc=simona@ffwll.ch \
--cc=ttabi@nvidia.com \
--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 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.