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>,
Timur Tabi <ttabi@nvidia.com>,
Eliot Courtney <ecourtney@nvidia.com>,
Zhi Wang <zhiw@nvidia.com>,
nova-gpu@lists.linux.dev, dri-devel@lists.freedesktop.org,
linux-kernel@vger.kernel.org,
Alexandre Courbot <acourbot@nvidia.com>
Subject: [PATCH 2/2] gpu: nova-core: gsp: cmdq: support GMC replies without payload
Date: Tue, 17 Nov 2026 00:06:46 +0900 [thread overview]
Message-ID: <20261117-cmdq-timeout-v1-2-4b50d0be335e@nvidia.com> (raw)
In-Reply-To: <20261117-cmdq-timeout-v1-0-4b50d0be335e@nvidia.com>
Some GMC commands are answered with a status and no payload. Their
reply type cannot be `NoReply`, which marks commands that the GSP does
not answer at all.
Implement `MessageFromGsp` for `()` so these commands can use it as
their reply type.
Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
---
drivers/gpu/nova-core/gsp/cmdq/gmc.rs | 17 +++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/nova-core/gsp/cmdq/gmc.rs b/drivers/gpu/nova-core/gsp/cmdq/gmc.rs
index 512a327a1c89..f4311593e360 100644
--- a/drivers/gpu/nova-core/gsp/cmdq/gmc.rs
+++ b/drivers/gpu/nova-core/gsp/cmdq/gmc.rs
@@ -3,6 +3,8 @@
//! Support for the GMC (GPU Management Controller) API message type on the GSP command queue.
+use core::convert::Infallible;
+
use kernel::{
device,
prelude::*,
@@ -53,8 +55,8 @@ pub(crate) trait CommandToGsp {
/// after the GMC API header.
type Command: FromBytes + AsBytes;
- /// Type of the reply expected from the GSP, or [`NoReply`] for commands that don't have a
- /// reply.
+ /// Type of the reply expected from the GSP. Can be [`NoReply`] for commands that don't have a
+ /// reply, or `()` for commands that only expect a status code without a reply payload.
type Reply;
/// Largest reply this command accepts, in bytes. Zero for commands that the GSP does not
@@ -178,6 +180,17 @@ fn read(
) -> Result<Self, Self::InitError>;
}
+/// Reply type for commands that the GSP answers with a status and no payload.
+impl MessageFromGsp for () {
+ type InitError = Infallible;
+
+ fn read(
+ _payload: &mut SBufferIter<core::array::IntoIter<&[u8], 2>>,
+ ) -> Result<Self, Self::InitError> {
+ Ok(())
+ }
+}
+
/// A GMC message ready to be processed from the message queue.
pub(crate) struct GmcMessage<'a> {
// Reference to the GMC API header of the message.
--
2.56.0
next prev parent reply other threads:[~2026-11-16 15:07 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-16 15:06 [PATCH 0/2] gpu: nova-core: gsp: cmdq: preparatory patches for r000 and vGPU Alexandre Courbot
2026-11-16 15:06 ` [PATCH 1/2] gpu: nova-core: gsp: cmdq: let GMC commands set their completion timeout Alexandre Courbot
2026-11-18 4:38 ` Eliot Courtney
2026-11-16 15:06 ` Alexandre Courbot [this message]
2026-11-18 4:39 ` [PATCH 2/2] gpu: nova-core: gsp: cmdq: support GMC replies without payload 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=20261117-cmdq-timeout-v1-2-4b50d0be335e@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=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.