[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250710194556.62605-1-dakr@kernel.org>
Date: Thu, 10 Jul 2025 21:45:42 +0200
From: Danilo Krummrich <dakr@...nel.org>
To: abdiel.janulgue@...il.com,
daniel.almeida@...labora.com,
robin.murphy@....com,
a.hindborg@...nel.org,
ojeda@...nel.org,
alex.gaynor@...il.com,
boqun.feng@...il.com,
gary@...yguo.net,
bjorn3_gh@...tonmail.com,
lossin@...nel.org,
aliceryhl@...gle.com,
tmgross@...ch.edu,
bhelgaas@...gle.com,
kwilczynski@...nel.org,
gregkh@...uxfoundation.org,
rafael@...nel.org
Cc: rust-for-linux@...r.kernel.org,
linux-pci@...r.kernel.org,
linux-kernel@...r.kernel.org,
Danilo Krummrich <dakr@...nel.org>
Subject: [PATCH 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]).
Link: https://lore.kernel.org/lkml/DB6YTN5P23X3.2S0NH4YECP1CP@kernel.org/ [1]
Link: https://git.kernel.org/pub/scm/linux/kernel/git/dakr/linux.git/log/?h=rust/dma-mask
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 | 95 +++++++++++++++++++++++++++++++++++++---
rust/kernel/pci.rs | 2 +
rust/kernel/platform.rs | 2 +
samples/rust/rust_dma.rs | 12 ++++-
5 files changed, 109 insertions(+), 7 deletions(-)
base-commit: d49ac7744f578bcc8708a845cce24d3b91f86260
--
2.50.0
Powered by blists - more mailing lists