Skip to content

dma::Device trait and DMA mask

Danilo Krummrich linux-pci lkml rust-for-linux 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest5 patches 10 repliesIn review
  2. v15 patches 12 repliesSuperseded

Changes in v2 from the cover letter

- replace dma_bit_mask() with a new type DmaMask
- mention that DmaMask is the Rust equivalent of the C macro DMA_BIT_MASK()
- make DmaMask::new() fallible
- inline DmaMask methods

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5rust: dma: implement `dma::Device` traitrust/kernel/dma.rs+12 -50 replies
2/5rust: dma: add DMA addressing capabilitiesrust/helpers/dma.c rust/kernel/dma.rs+113 -47 replies
3/5rust: pci: implement the `dma::Device` traitrust/kernel/pci.rs+2 -00 replies
4/5rust: platform: implement the `dma::Device` traitrust/kernel/platform.rs+2 -00 replies
5/5rust: samples: dma: set DMA masksamples/rust/rust_dma.rs+13 -10 replies

Reviews trailers per patch

3 of 5 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchAbdiel JanulgueGreg Kroah-HartmanDaniel Almeida
SeriesR-b R-b
1/5R-b
2/5R-b
3/5
4/5
5/5R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v2 thread

Cover letter [PATCH v2 0/5] dma::Device trait and DMA mask

This patch series adds the dma::Device trait to be implemented by bus devices on DMA capable busses.

The dma::Device trait implements methods to set the DMA mask for for such devices.

The first two bus devices implementing the trait are PCI and platform.

Unfortunately, the DMA mask setters have to be unsafe for now, since, with reasonable effort, we can't prevent drivers from data races writing and reading the DMA mask fields concurrently (see also [1]).

Changes in v2:
- replace dma_bit_mask() with a new type DmaMask
- mention that DmaMask is the Rust equivalent of the C macro DMA_BIT_MASK()
- make DmaMask::new() fallible
- inline DmaMask methods

Danilo Krummrich (5):
rust: dma: implement dma::Device trait
rust: dma: add DMA addressing capabilities
rust: pci: implement the dma::Device trait
rust: platform: implement the dma::Device trait
rust: samples: dma: set DMA mask

 rust/helpers/dma.c       |   5 ++
 rust/kernel/dma.rs       | 125 ++++++++++++++++++++++++++++++++++++---
 rust/kernel/pci.rs       |   2 +
 rust/kernel/platform.rs  |   2 +
 samples/rust/rust_dma.rs |  14 ++++-
 5 files changed, 140 insertions(+), 8 deletions(-)

base-commit: d49ac7744f578bcc8708a845cce24d3b91f86260

Signature · 1 line
2.50.0