public inbox for rust-for-linux@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] gpu: nova-core: use GSP RPC sequence numbers properly
@ 2026-02-11  0:04 John Hubbard
  2026-02-11  0:04 ` [PATCH 1/2] gpu: nova-core: fix GSP RPC send sequence numbers to match Open RM John Hubbard
  2026-02-11  0:04 ` [PATCH 2/2] gpu: nova-core: improve GSP RPC debug logging with message classification John Hubbard
  0 siblings, 2 replies; 6+ messages in thread
From: John Hubbard @ 2026-02-11  0:04 UTC (permalink / raw)
  To: Danilo Krummrich, Alexandre Courbot
  Cc: Joel Fernandes, Timur Tabi, Alistair Popple, Eliot Courtney,
	Zhi Wang, David Airlie, Simona Vetter, Bjorn Helgaas,
	Miguel Ojeda, Alex Gaynor, Boqun Feng, Gary Guo,
	Björn Roy Baron, Benno Lossin, Andreas Hindborg, Alice Ryhl,
	Trevor Gross, nouveau, rust-for-linux, LKML, John Hubbard,
	Maneet Singh

There are two sequence number fields per GSP RPC message: an outer
transport-level seqNum in the GSP_MSG_QUEUE_ELEMENT header, and an
inner rpc.sequence in the rpc_message_header_v. Nova was leaving the
inner field at zero for all sends and had no way to tell async events
apart from command responses on the receive side.

This led to really confusing log messages and code as well.

Patch 1 fixes the wire-level sequence numbers to match Open RM.
Patch 2 updates the debug logging to show the message classification.

This is "GSP future friendly", in that it is written with GSP seq number
handling plans in mind. I'm including Maneet Singh to help poke holes in
that claim.

Example output:

  GSP RPC: async send: seq# 0, function=GSP_SET_SYSTEM_INFO, length=0x3f0
  GSP RPC: async send: seq# 1, function=SET_REGISTRY, length=0xc5
  GSP RPC: async received: seq# 0, function=LOCKDOWN_NOTICE, length=0x51
  GSP RPC: async received: seq# 17, function=INIT_DONE, length=0x50
  GSP RPC: send: seq# 2, function=GET_GSP_STATIC_INFO, length=0x6c8
  GSP RPC: response received: seq# 2, function=GET_GSP_STATIC_INFO, length=0x6c8

With the inner rpc.sequence now set correctly, GSP echoes back the
CPU's sequence number in command responses, so the response seq#
matches the send seq#.

This is based on the Feb 5, 2026 linux-next: commit 9845cf73f7db ("Add
linux-next specific files for 20260205").

Also, this should be applied on top of Eliot Courtney's command queue
ring buffer fix series [1]. Without it, I was seeing slice bounds panics
in driver_read_area().

And finally, because I expect this to go in likely after Blackwell (or
not?), I've based it on that. So putting all that together, there is
a branch with [1] and Blackwell and this series, here for convenience:

  https://github.com/johnhubbard/linux/tree/nova-core-gsp-rpc-seq-numbers-v0


[1] https://lore.kernel.org/r/20260129-nova-core-cmdq1-v3-0-2ede85493a27@nvidia.com

Cc: Maneet Singh <mmaneetsingh@nvidia.com>

John Hubbard (2):
  gpu: nova-core: fix GSP RPC send sequence numbers to match Open RM
  gpu: nova-core: improve GSP RPC debug logging with message
    classification

 drivers/gpu/nova-core/gsp/boot.rs     |  6 +-
 drivers/gpu/nova-core/gsp/cmdq.rs     | 84 +++++++++++++++++++++------
 drivers/gpu/nova-core/gsp/commands.rs |  2 +
 drivers/gpu/nova-core/gsp/fw.rs       | 35 +++++++++--
 4 files changed, 104 insertions(+), 23 deletions(-)


base-commit: 6738f143db92177013a500fbea5edd771c173bf9
-- 
2.53.0


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-02-17 11:52 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-11  0:04 [PATCH 0/2] gpu: nova-core: use GSP RPC sequence numbers properly John Hubbard
2026-02-11  0:04 ` [PATCH 1/2] gpu: nova-core: fix GSP RPC send sequence numbers to match Open RM John Hubbard
2026-02-17  8:15   ` Alexandre Courbot
2026-02-17 11:52     ` Danilo Krummrich
2026-02-11  0:04 ` [PATCH 2/2] gpu: nova-core: improve GSP RPC debug logging with message classification John Hubbard
2026-02-17 11:04   ` Alexandre Courbot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox