[PATCH v5 0/9] gpu: nova-core: gsp: add continuation record support
From: Eliot Courtney
Date: Tue Mar 03 2026 - 20:44:23 EST
GSP commands over 16 pages need to be sent using "continuation records"
which essentially means splitting the payload over multiple commands.
This series adds a command type `ContinuationRecord` which just writes
its header and whatever payload it is given. It also adds types
`SplitState` and `SplitCommand` which support splitting a large RPC
into smaller ones while transparently letting regular sized RPCs be sent
without extra copies.
The send pathway uses `SplitState` to send all commands, but if
the command fits into 16 pages, it still writes directly into the
command queue. If it is larger than 16 pages and needs continuation
records, it writes into a staging buffer, so there is one copy.
Signed-off-by: Eliot Courtney <ecourtney@xxxxxxxxxx>
---
Changes in v5:
- Moved continuation module under cmdq.
- Made timeout into a constant.
- Renamed command_size to size_in_bytes and made it a default method
on CommandToGsp
- Link to v4: https://lore.kernel.org/r/20260302-cmdq-continuation-v4-0-c011f15aad58@xxxxxxxxxx
Changes in v4:
- Removed Tested-by Zhi on the ContinuationRecord patch, since it
changed substantively.
- Incorporated Alex's design for SplitState
- Moved the continuation record types into their own module.
- Tightened visibility on continuation record types.
- Used non-zero sized command in tests.
- Link to v3: https://lore.kernel.org/r/20260226-cmdq-continuation-v3-0-572ab9916766@xxxxxxxxxx
Changes in v3:
- Rebased onto drm-rust-next
- Added some doc comments
- Reworded command_size doc comment
- Link to v2: https://lore.kernel.org/r/20260219-cmdq-continuation-v2-0-2e8b7615536f@xxxxxxxxxx
Changes in v2:
- Added doccoments
- Renamed driver_bytes_available_to_write to driver_write_area_size
- allocate_command_with_timeout merged allocate_command with timeout parameter
- Replaced hardcoded GSP_PAGE_SIZE * 16 with bindings
- Changed oversized command error from EIO to EMSGSIZE
- Added EMSGSIZE to kernel/error.rs
- Split WrappingCommand functionality into SplitState + SplitCommand enum
- Made max_size a const (MAX_CMD_SIZE)
- Removed send_continuation_record + added comment for type inference
- send_single_command now consumes the command
- Extracted command_size + used in SplitState
- Link to v1: https://lore.kernel.org/r/20260212-cmdq-continuation-v1-0-73079ded55e6@xxxxxxxxxx
---
Eliot Courtney (9):
gpu: nova-core: gsp: sort `MsgFunction` variants alphabetically
gpu: nova-core: gsp: add mechanism to wait for space on command queue
rust: add EMSGSIZE error code
gpu: nova-core: gsp: add checking oversized commands
gpu: nova-core: gsp: clarify invariant on command queue
gpu: nova-core: gsp: unconditionally call variable payload handling
gpu: nova-core: gsp: add `size_in_bytes` helper to `CommandToGsp`
gpu: nova-core: gsp: support large RPCs via continuation record
gpu: nova-core: gsp: add tests for continuation records
drivers/gpu/nova-core/gsp/cmdq.rs | 119 +++++++--
drivers/gpu/nova-core/gsp/cmdq/continuation.rs | 301 ++++++++++++++++++++++
drivers/gpu/nova-core/gsp/fw.rs | 75 +++---
drivers/gpu/nova-core/gsp/fw/r570_144/bindings.rs | 1 +
rust/kernel/error.rs | 1 +
5 files changed, 439 insertions(+), 58 deletions(-)
---
base-commit: 4a49fe23e357b48845e31fe9c28a802c05458198
change-id: 20260203-cmdq-continuation-b99f3d5966c3
Best regards,
--
Eliot Courtney <ecourtney@xxxxxxxxxx>