[PATCH 0/2] gpu: nova-core: retain the GSP-RM log buffers

From: Vladislav Zaharov

Date: Wed Aug 12 2026 - 07:43:14 EST


The GSP-RM log buffers are exposed through debugfs, but the entries are
owned by the Gpu that probe() builds, and the buffers themselves are DMA
allocations that cannot outlive the device. They are therefore gone as
soon as the GPU is unbound, and in particular as soon as probe() fails -
which is the case todo.rst singled out ("even after failure to probe the
driver"), and the one where a GSP log is worth having.

Patch 1 adds CONFIG_NOVA_CORE_KEEP_GSP_LOGS: when the log buffers are
dropped, whatever the GSP wrote is copied into memory owned by the
module and exposed under a "retained" directory until the module is
unloaded. Patch 2 drops the now completed task from todo.rst.

nouveau has the same feature behind its keep_gsp_logging module
parameter. It recreates the entries under the name of the GPU that just
went away, which collides with that GPU coming back; the "retained"
directory here avoids that.

Tested on a GB203 (RTX 5080), which the driver probes successfully:

- after an unbind, retained/<BDF>/{loginit,logintr,logrm} hold the
contents the live entries had;
- with a failure injected after the GSP has booted, probe() fails and
the logs of that attempt are still readable;
- binding the GPU again does not disturb the copies, and unbinding it
a second time replaces them;
- the copies are released on module unload, with nothing left behind;
- with the option off, the entries disappear on unbind as before.

Built and checked with CLIPPY=1 and rustfmtcheck for both settings of
the new option.

The testing was done on top of e6c2c6265521 ("rust: firmware: add
request_into_buf()"), that is, before the TLV firmware series, because
the nvidia/*/gsp/*.tlv images are not in linux-firmware yet and the
driver therefore cannot load firmware at the current tip. The series
applies and builds unchanged on top of drm-rust-next.

Vladislav Zaharov (2):
gpu: nova-core: gsp: retain the GSP-RM log buffers after unbind
Documentation: nova: remove completed GSP log buffer task

Documentation/gpu/nova/core/todo.rst | 12 ---
drivers/gpu/nova-core/Kconfig | 18 ++++
drivers/gpu/nova-core/gsp.rs | 146 +++++++++++++++++++++++++++
drivers/gpu/nova-core/nova_core.rs | 19 ++++
4 files changed, 183 insertions(+), 12 deletions(-)

--
2.55.0