From: Alvin Sun <alvin.sun@linux.dev>
To: "Miguel Ojeda" <ojeda@kernel.org>,
"Boqun Feng" <boqun@kernel.org>, "Gary Guo" <gary@garyguo.net>,
"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
"Benno Lossin" <lossin@kernel.org>,
"Andreas Hindborg" <a.hindborg@kernel.org>,
"Alice Ryhl" <aliceryhl@google.com>,
"Trevor Gross" <tmgross@umich.edu>,
"Danilo Krummrich" <dakr@kernel.org>,
"Daniel Almeida" <daniel.almeida@collabora.com>,
"Tamir Duberstein" <tamird@kernel.org>,
"Alexandre Courbot" <acourbot@nvidia.com>,
"Onur Özkan" <work@onurozkan.dev>,
"Greg Kroah-Hartman" <gregkh@kernel.org>,
"Rafael J. Wysocki" <rafael@kernel.org>,
"Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
"Maxime Ripard" <mripard@kernel.org>,
"Thomas Zimmermann" <tzimmermann@suse.de>,
"David Airlie" <airlied@gmail.com>,
"Simona Vetter" <simona@ffwll.ch>
Cc: "Alexander Viro" <viro@zeniv.linux.org.uk>,
"Christian Brauner" <brauner@kernel.org>,
"Jan Kara" <jack@suse.cz>,
"Matthew Brost" <matthew.brost@intel.com>,
"Thomas Hellström" <thomas.hellstrom@linux.intel.com>,
rust-for-linux@vger.kernel.org, driver-core@lists.linux.dev,
dri-devel@lists.freedesktop.org,
"Alvin Sun" <alvin.sun@linux.dev>
Subject: [PATCH v3 0/8] drm/tyr: add debugfs support
Date: Fri, 07 Aug 2026 01:07:22 +0800 [thread overview]
Message-ID: <20260807-tyr-debugfs-v2-v3-0-ff5595ac66ae@linux.dev> (raw)
Add debugfs support for the Tyr DRM driver.
The series adds a SeqShow trait for seq_file-backed debugfs files, a
debugfs_init callback on the DRM Driver trait, and a gpuvas debugfs
file in Tyr exposing GPU VA space information.
This is based on drm-rust-next and depends on:
[PATCH v10 0/7] drm/tyr: firmware loading and MCU boot support
https://lore.kernel.org/r/20260728-fw-boot-b4-v10-0-9187aefa3f2f@collabora.com
See the full dependency and commit history at [1].
Link: https://gitlab.freedesktop.org/panfrost/linux/-/issues/11
Link: https://gitlab.freedesktop.org/panfrost/linux/-/merge_requests/59 [1]
Signed-off-by: Alvin Sun <alvin.sun@linux.dev>
---
Changes in v3:
- Drop the DrmSeqShow adapter and use SeqShow directly, per Danilo's
feedback. Simplify the debugfs_init callback signature accordingly.
- Redesign VmRegistry per Daniel's and Alice's feedback: move it to
vm.rs at the top level of the registration data, use Arc<VmRegistry>
for shared ownership, and separate register/unregister from Vm::new
and Vm::kill. Registration failure is non-fatal (dev_warn) since the
registry is a debugfs convenience.
- Add VmRegistry::unregister to remove VMs on teardown, addressing
Alice's concern about the list going out of sync.
- Drop the "hold device reference for open files" patch; the debugfs
proxy fops already ensure file operations cannot outlive
debugfs_remove().
- Improve SAFETY comments and fix style issues identified during review.
- Link to v2: https://lore.kernel.org/r/20260731-tyr-debugfs-v2-v2-0-aea19eccb996@linux.dev
Changes in v2:
- Reworked the debugfs implementation per feedback from Danilo on v1:
dropped the hazptr/revocable-based approach in favor of the DRM
debugfs_init callback and generic seq_file abstractions.
- Fixed a UAF in drm_debugfs where a device could be unregistered while
a debugfs file remains open (drm_dev_get/put across file lifetime).
- Link to v1: https://lore.kernel.org/r/20260326-b4-tyr-debugfs-v1-0-074badd18716@linux.dev
---
Alvin Sun (8):
rust: seq_file: add as_raw() method
rust: debugfs: add seq_file support
rust: debugfs: add ScopeRef for existing dentries
drm: move debugfs_init after dev->registered is set
rust: drm: add debugfs_init callback to Driver trait
rust: drm: gpuvm: add dump_gpuva_info to UniqueRefGpuVm
drm/tyr: track VMs in a registry
drm/tyr: add gpuvas debugfs file
drivers/gpu/drm/drm_debugfs.c | 3 --
drivers/gpu/drm/drm_drv.c | 5 +++
drivers/gpu/drm/tyr/debugfs.rs | 20 ++++++++++
drivers/gpu/drm/tyr/driver.rs | 16 +++++++-
drivers/gpu/drm/tyr/fw.rs | 18 +++++++--
drivers/gpu/drm/tyr/tyr.rs | 1 +
drivers/gpu/drm/tyr/vm.rs | 33 ++++++++++++++++
rust/bindings/bindings_helper.h | 1 +
rust/kernel/debugfs.rs | 84 ++++++++++++++++++++++++++++++++++++++++-
rust/kernel/debugfs/entry.rs | 15 +++++++-
rust/kernel/debugfs/file_ops.rs | 60 +++++++++++++++++++++++++++++
rust/kernel/debugfs/traits.rs | 11 ++++++
rust/kernel/drm/device.rs | 41 +++++++++++++++++++-
rust/kernel/drm/driver.rs | 11 ++++++
rust/kernel/drm/gpuvm/mod.rs | 9 +++++
rust/kernel/seq_file.rs | 6 +++
16 files changed, 323 insertions(+), 11 deletions(-)
---
base-commit: 0ffc014cb2abfc79d161662b125e085b3e7107e7
change-id: 20260730-tyr-debugfs-v2-608cef77d6e9
Best regards,
--
Alvin Sun <alvin.sun@linux.dev>
next reply other threads:[~2026-08-06 17:10 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-06 17:07 Alvin Sun [this message]
2026-08-06 17:07 ` [PATCH v3 1/8] rust: seq_file: add as_raw() method Alvin Sun
2026-08-06 17:07 ` [PATCH v3 2/8] rust: debugfs: add seq_file support Alvin Sun
2026-08-06 17:07 ` [PATCH v3 3/8] rust: debugfs: add ScopeRef for existing dentries Alvin Sun
2026-08-06 17:07 ` [PATCH v3 4/8] drm: move debugfs_init after dev->registered is set Alvin Sun
2026-08-06 17:07 ` [PATCH v3 5/8] rust: drm: add debugfs_init callback to Driver trait Alvin Sun
2026-08-06 17:07 ` [PATCH v3 6/8] rust: drm: gpuvm: add dump_gpuva_info to UniqueRefGpuVm Alvin Sun
2026-08-06 17:07 ` [PATCH v3 7/8] drm/tyr: track VMs in a registry Alvin Sun
2026-08-06 17:07 ` [PATCH v3 8/8] drm/tyr: add gpuvas debugfs file Alvin Sun
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260807-tyr-debugfs-v2-v3-0-ff5595ac66ae@linux.dev \
--to=alvin.sun@linux.dev \
--cc=a.hindborg@kernel.org \
--cc=acourbot@nvidia.com \
--cc=airlied@gmail.com \
--cc=aliceryhl@google.com \
--cc=bjorn3_gh@protonmail.com \
--cc=boqun@kernel.org \
--cc=brauner@kernel.org \
--cc=dakr@kernel.org \
--cc=daniel.almeida@collabora.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=driver-core@lists.linux.dev \
--cc=gary@garyguo.net \
--cc=gregkh@kernel.org \
--cc=jack@suse.cz \
--cc=lossin@kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=matthew.brost@intel.com \
--cc=mripard@kernel.org \
--cc=ojeda@kernel.org \
--cc=rafael@kernel.org \
--cc=rust-for-linux@vger.kernel.org \
--cc=simona@ffwll.ch \
--cc=tamird@kernel.org \
--cc=thomas.hellstrom@linux.intel.com \
--cc=tmgross@umich.edu \
--cc=tzimmermann@suse.de \
--cc=viro@zeniv.linux.org.uk \
--cc=work@onurozkan.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox