[PATCH v3 3/8] gpu: nova-core: fsp: rename FSP response header type

From: Zhi Wang

Date: Wed Jul 01 2026 - 02:29:42 EST


FSP message handling currently uses FspResponse for the common response
prefix containing the MCTP header, NVDM header and command response
payload.

That name is too broad once other FSP response formats reuse the same
prefix and append protocol-specific payloads. Rename it to
FspResponseHeader so subsequent response structures can embed the common
header without overloading the meaning of FspResponse.

Suggested-by: Alexandre Courbot <acourbot@xxxxxxxxxx>
Link: https://lore.kernel.org/all/DJMBI9CN2Z67.2T02SR8TAWEC5@xxxxxxxxxx/
Signed-off-by: Zhi Wang <zhiw@xxxxxxxxxx>
---
drivers/gpu/nova-core/fsp.rs | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/nova-core/fsp.rs b/drivers/gpu/nova-core/fsp.rs
index 574e1627e63c..a555c5290baa 100644
--- a/drivers/gpu/nova-core/fsp.rs
+++ b/drivers/gpu/nova-core/fsp.rs
@@ -84,16 +84,16 @@ fn new(nvdm_type: NvdmType) -> Self {
}
}

-/// Complete FSP response structure with MCTP and NVDM headers.
+/// Common FSP response header with MCTP, NVDM and command response payloads.
#[repr(C, packed)]
#[derive(Clone, Copy)]
-struct FspResponse {
+struct FspResponseHeader {
header: FspMessageHeader,
response: NvdmPayloadCommandResponse,
}

-// SAFETY: FspResponse is a packed C struct with only integral fields.
-unsafe impl FromBytes for FspResponse {}
+// SAFETY: FspResponseHeader is a packed C struct with only integral fields.
+unsafe impl FromBytes for FspResponseHeader {}

/// Trait implemented by types representing a message to send to FSP.
///
@@ -272,10 +272,11 @@ fn send_sync_fsp<M>(&mut self, dev: &device::Device, msg: &M) -> Result<KVec<u8>
dev_err!(dev, "FSP response error: {:?}\n", e);
})?;

- let (response, _) = FspResponse::from_bytes_prefix(&response_buf[..]).ok_or_else(|| {
- dev_err!(dev, "FSP response too small: {}\n", response_buf.len());
- EIO
- })?;
+ let (response, _) =
+ FspResponseHeader::from_bytes_prefix(&response_buf[..]).ok_or_else(|| {
+ dev_err!(dev, "FSP response too small: {}\n", response_buf.len());
+ EIO
+ })?;

let mctp_header = response.header.mctp_header;
let nvdm_header = response.header.nvdm_header;
--
2.51.0