nouveau.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/9] gpu: nova-core: expose the logging buffers via debugfs
@ 2025-12-18  1:39 Timur Tabi
  2025-12-18  1:39 ` [PATCH v3 1/9] rust: pci: add PCI device name method Timur Tabi
                   ` (10 more replies)
  0 siblings, 11 replies; 23+ messages in thread
From: Timur Tabi @ 2025-12-18  1:39 UTC (permalink / raw)
  To: Gary Guo, Danilo Krummrich, rust-for-linux, John Hubbard,
	Joel Fernandes, Alexandre Courbot, Lyude Paul, nouveau

GSP-RM writes its printf message to "logging buffers", which are blocks
memory allocated by the driver.  The messages are encoded, so exposing
the buffers as debugfs entries allows the buffers to be extracted and
decoded by a special application.

When the driver loads, a /sys/kernel/debug/nova_core root entry is
created.  To do this, the normal module_pci_driver! macro call is
replaced with an explicit initialization function, as this allows
that debugfs entry to be created once for all GPUs.

Then in each GPU's initialization, a subdirectory based on the PCI
BDF name is created, and the logging buffer entries are created under
that.

Note: the debugfs entry has a file size of 0, because debugfs defaults
a 0 size and the Rust abstractions do not adjust it for the same of
the object.  Nouveau makes this adjustment manually in the driver.

Based on Linus' repository, not drm-rust-next.

Summary of changes:

1. Replace module_pci_driver! with explicit init function.
2. Creates root, per-gpu, and individual buffer debugfs entries.
3. Adds a pci::name() method to generate a PCI device name string.
4. Adds a lookup() method to debugfs, so that the root debugfs entry
   doesn't need to be a global variable like it is in Nouveau.
5. Makes some updates to debugfs core code.

Alexandre Courbot (1):
  gpu: nova-core: implement BinaryWriter for LogBuffer

Timur Tabi (8):
  rust: pci: add PCI device name method
  rust: debugfs: add lookup contructor
  rust: debugfs: add Dir::empty() for no-op directory handle
  rust: debugfs: fix Dir::scope() to not borrow self for returned
    lifetime
  gpu: nova-core: Replace module_pci_driver! with explicit module init
  gpu: nova-core: create debugfs root when driver loads
  gpu: nova-core: use pin projection in method boot()
  gpu: nova-core: create GSP-RM logging buffers debugfs entries

 drivers/gpu/nova-core/gsp.rs       |  66 +++++++++++++++---
 drivers/gpu/nova-core/gsp/boot.rs  |  15 ++--
 drivers/gpu/nova-core/nova_core.rs |  29 +++++++-
 rust/kernel/debugfs.rs             | 108 ++++++++++++++++++++++-------
 rust/kernel/debugfs/entry.rs       |  49 ++++++++++++-
 rust/kernel/pci.rs                 |  37 ++++++++++
 6 files changed, 259 insertions(+), 45 deletions(-)


base-commit: ea1013c1539270e372fc99854bc6e4d94eaeff66
-- 
2.52.0


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

end of thread, other threads:[~2025-12-21 10:06 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-18  1:39 [PATCH v3 0/9] gpu: nova-core: expose the logging buffers via debugfs Timur Tabi
2025-12-18  1:39 ` [PATCH v3 1/9] rust: pci: add PCI device name method Timur Tabi
2025-12-18  8:05   ` Alice Ryhl
2025-12-18  8:55   ` Danilo Krummrich
2025-12-18 10:09   ` Miguel Ojeda
2025-12-18  1:39 ` [PATCH v3 2/9] rust: debugfs: add lookup contructor Timur Tabi
2025-12-18  9:40   ` Danilo Krummrich
2025-12-18 18:00   ` Matthew Maurer
2025-12-18  1:39 ` [PATCH v3 3/9] rust: debugfs: add Dir::empty() for no-op directory handle Timur Tabi
2025-12-18  1:39 ` [PATCH v3 4/9] rust: debugfs: fix Dir::scope() to not borrow self for returned lifetime Timur Tabi
2025-12-18 17:55   ` Matthew Maurer
2025-12-18  1:39 ` [PATCH v3 5/9] gpu: nova-core: Replace module_pci_driver! with explicit module init Timur Tabi
2025-12-18  9:01   ` Danilo Krummrich
2025-12-18  1:39 ` [PATCH v3 6/9] gpu: nova-core: create debugfs root when driver loads Timur Tabi
2025-12-18 10:10   ` Danilo Krummrich
2025-12-18  1:39 ` [PATCH v3 7/9] gpu: nova-core: implement BinaryWriter for LogBuffer Timur Tabi
2025-12-18 10:18   ` Danilo Krummrich
2025-12-18 11:14   ` Alexandre Courbot
2025-12-18  1:39 ` [PATCH v3 8/9] gpu: nova-core: use pin projection in method boot() Timur Tabi
2025-12-18  1:39 ` [PATCH v3 9/9] gpu: nova-core: create GSP-RM logging buffers debugfs entries Timur Tabi
2025-12-21 10:05   ` kernel test robot
2025-12-18  8:07 ` [PATCH v3 0/9] gpu: nova-core: expose the logging buffers via debugfs Alice Ryhl
2025-12-18  8:44 ` Danilo Krummrich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).