[PATCH v2 15/32] gpu: nova-core: gsp: add status-only GMC transactions
From: Zhi Wang
Date: Mon Sep 14 2026 - 04:13:24 EST
GMC operations such as GSP plugin resource cleanup have no response
payload, but still report success or failure in the response header.
Add a helper that waits for the matching response with a zero payload
limit and converts a nonzero firmware status to EIO.
Co-developed-by: Alok Kumar <alkumar@xxxxxxxxxx>
Signed-off-by: Alok Kumar <alkumar@xxxxxxxxxx>
Signed-off-by: Zhi Wang <zhiw@xxxxxxxxxx>
---
drivers/gpu/nova-core/gsp/cmdq.rs | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/nova-core/gsp/cmdq.rs b/drivers/gpu/nova-core/gsp/cmdq.rs
index 9fb17e576eb8..891dec5c108a 100644
--- a/drivers/gpu/nova-core/gsp/cmdq.rs
+++ b/drivers/gpu/nova-core/gsp/cmdq.rs
@@ -503,7 +503,6 @@ pub(crate) enum QueuePointers {
/// Response from a GMC API command.
pub(crate) struct GmcResponse {
/// Response status (`NV_STATUS` code). Zero means success.
- #[expect(dead_code)]
pub(crate) status: u32,
/// Response payload copied out of the message queue.
#[expect(dead_code)]
@@ -652,7 +651,6 @@ pub(crate) fn send_gmc_no_wait(
///
/// The queue stays locked for the complete transaction. A single deadline bounds all queue
/// elements observed while waiting.
- #[expect(dead_code)]
pub(crate) fn send_gmc_and_receive(
&self,
command_id: u32,
@@ -736,6 +734,17 @@ pub(crate) fn send_gmc_and_receive_timeout(
}
}
+ /// Sends a synchronous GMC command and checks its status-only reply.
+ #[expect(dead_code)]
+ pub(crate) fn send_gmc_and_check_status(&self, command_id: u32, payload: &[u8]) -> Result {
+ let response = self.send_gmc_and_receive(command_id, payload, 0)?;
+ if response.status == 0 {
+ Ok(())
+ } else {
+ Err(EIO)
+ }
+ }
+
/// Waits for an unsolicited GSP event of type `M`, consuming any other event that arrives
/// first.
///