dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] rust: dma: tie DMA allocations to the device's bound lifetime
@ 2026-08-30 19:37 Danilo Krummrich
  2026-08-30 19:37 ` [PATCH 1/4] rust: debugfs: drop 'static bound from ScopedDir file creation methods Danilo Krummrich
                   ` (3 more replies)
  0 siblings, 4 replies; 16+ messages in thread
From: Danilo Krummrich @ 2026-08-30 19:37 UTC (permalink / raw)
  To: dakr, abdiel.janulgue, daniel.almeida, robin.murphy, a.hindborg,
	gregkh, rafael, aliceryhl, acourbot, ojeda, boqun, gary,
	bjorn3_gh, lossin, tmgross, tamird, work, mmaurer
  Cc: driver-core, nova-gpu, dri-devel, linux-kernel, rust-for-linux

DMA allocations carry device resources (e.g. IOMMU mappings) that must not
outlive the device's bound lifetime. Add lifetime parameters to the DMA
allocation types (Coherent, CoherentBox, CoherentHandle) to enforce at compile
time that they are freed before the device is unbound.

Since DMA types with lifetime parameters are exposed through debugfs in the
nova-core driver, first drop the unnecessary T: 'static bound from the debugfs
ScopedDir file creation methods by formalizing a type invariant on FileOps.

Danilo Krummrich (4):
  rust: debugfs: drop 'static bound from ScopedDir file creation methods
  rust: dma: tie CoherentHandle to the device's bound lifetime
  samples: rust_dma: separate driver type from driver data
  rust: dma: tie Coherent and CoherentBox to the device's bound lifetime

 drivers/gpu/nova-core/falcon.rs               |   2 +-
 drivers/gpu/nova-core/fb.rs                   |   4 +-
 drivers/gpu/nova-core/firmware/booter.rs      |   2 +-
 drivers/gpu/nova-core/firmware/fsp.rs         |   8 +-
 .../nova-core/firmware/fwsec/bootloader.rs    |  12 +-
 drivers/gpu/nova-core/firmware/gsp.rs         |  14 +-
 drivers/gpu/nova-core/firmware/riscv.rs       |   8 +-
 drivers/gpu/nova-core/fsp.rs                  |  20 +--
 drivers/gpu/nova-core/gpu.rs                  |   4 +-
 drivers/gpu/nova-core/gsp.rs                  |  30 ++--
 drivers/gpu/nova-core/gsp/boot.rs             |  10 +-
 drivers/gpu/nova-core/gsp/cmdq.rs             |  35 +++--
 drivers/gpu/nova-core/gsp/commands.rs         |   2 +-
 drivers/gpu/nova-core/gsp/fw.rs               |  12 +-
 drivers/gpu/nova-core/gsp/hal.rs              |  14 +-
 drivers/gpu/nova-core/gsp/hal/gh100.rs        |  16 +-
 drivers/gpu/nova-core/gsp/hal/tu102.rs        |  34 ++---
 drivers/gpu/nova-core/gsp/sequencer.rs        |   6 +-
 rust/kernel/debugfs.rs                        |  26 +---
 rust/kernel/debugfs/entry.rs                  |   4 +-
 rust/kernel/debugfs/file_ops.rs               |  52 ++++---
 rust/kernel/dma.rs                            | 141 +++++++++---------
 rust/kernel/uaccess.rs                        |   4 +-
 samples/rust/rust_dma.rs                      |  30 ++--
 24 files changed, 241 insertions(+), 249 deletions(-)


base-commit: 45c13f3f9e3bb15fd89ff2864c6f627a3b4b4229
-- 
2.55.0


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

end of thread, other threads:[~2026-09-03 15:42 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-30 19:37 [PATCH 0/4] rust: dma: tie DMA allocations to the device's bound lifetime Danilo Krummrich
2026-08-30 19:37 ` [PATCH 1/4] rust: debugfs: drop 'static bound from ScopedDir file creation methods Danilo Krummrich
2026-08-30 19:53   ` sashiko-bot
2026-09-03 13:12   ` Gary Guo
2026-09-03 15:07     ` Danilo Krummrich
2026-09-03 15:16       ` Gary Guo
2026-08-30 19:37 ` [PATCH 2/4] rust: dma: tie CoherentHandle to the device's bound lifetime Danilo Krummrich
2026-09-03 13:12   ` Gary Guo
2026-08-30 19:37 ` [PATCH 3/4] samples: rust_dma: separate driver type from driver data Danilo Krummrich
2026-08-30 19:57   ` sashiko-bot
2026-09-03 13:13   ` Gary Guo
2026-08-30 19:37 ` [PATCH 4/4] rust: dma: tie Coherent and CoherentBox to the device's bound lifetime Danilo Krummrich
2026-08-30 19:47   ` sashiko-bot
2026-09-03 13:20   ` Gary Guo
2026-09-03 15:22     ` Danilo Krummrich
2026-09-03 15:42       ` Gary Guo

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