Skip to content

rust: dma: tie DMA allocations to the device's bound lifetime

Danilo Krummrich dri-devel driver-core lkml nova-gpu rust-for-linux 1 version Applied

Status from this message: Applied, thanks!

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 10 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/4rust: debugfs: drop 'static bound from ScopedDir file creation methodsrust/kernel/debugfs.rs rust/kernel/debugfs/entry.rs rust/kernel/debugfs/file_ops.rs+39 -433 replies
2/4rust: dma: tie CoherentHandle to the device's bound lifetimedrivers/gpu/nova-core/fb.rs rust/kernel/dma.rs+11 -111 reply
3/4samples: rust_dma: separate driver type from driver datasamples/rust/rust_dma.rs+15 -111 reply
4/4rust: dma: tie Coherent and CoherentBox to the device's bound lifetimedrivers/gpu/nova-core/falcon.rs drivers/gpu/nova-core/fb.rs drivers/gpu/nova-core/firmware/booter.rs +18 more+176 -1843 replies

Reviews trailers per patch

All 4 patches have a Reviewed-by or Acked-by.

PatchGary Guo
1/4R-b
2/4R-b
3/4R-b
4/4R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/4] rust: dma: tie DMA allocations to the device's bound lifetime

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

Signature · 1 line
2.55.0