On 5/18/26 18:09, Danilo Krummrich wrote:
On Thu Mar 26, 2026 at 7:53 AM CET, Alvin Sun wrote:
+#[pin_data]
+struct TyrModule {
+ _debugfs_root: HazPtrRevokeHandle<'static, kernel::debugfs::Dir>,
+ #[pin]
+ _driver: Registration<platform::Adapter<TyrPlatformDriverData>>,
+}
+
+impl InPlaceModule for TyrModule {
+ fn init(module: &'static kernel::ThisModule) -> impl PinInit<Self,
error::Error> {
+ let dir = kernel::debugfs::Dir::new(kernel::c_str!("tyr"));
Why does Tyr need its own debugfs directory to expose DRM data structures? DRM
already has a common debugfs directory per DRM device in /sys/kernel/debug/dri/,
which you should attach to instead if you want to expose driver specific files.
Hi Danilo,
Sorry for the late reply, I was busy with the fops owner patch series
last week.
Thank you for the detailed review and suggestions. I've reworked the
implementation based on your feedback:
- Instead of creating a separate tyr debugfs directory, the code
now hooks into the DRM core's per-device debugfs root under
/sys/kernel/debug/dri/ via a debugfs_init callback.
- The duplicated show_vm() code is eliminated — the gpuvas file now
reuses the existing drm_debugfs_gpuva_info() through a safe Rust
wrapper, rather than re-implementing the VA space dump.
Note that the GEM debugfs interface is not yet implemented — I'd like
to get your feedback on the overall approach first before continuing
with that part.
Please review the updated series [1] and let me know your thoughts.
[1]
https://gitlab.freedesktop.org/alvinsun039/linux/-/commits/tyr-debugfs-v2
Best regards,
Alvin