Files
linux/rust/kernel
Danilo Krummrich 80f4a7b513 rust: dma: introduce dma::CoherentBox for memory initialization
Currently, dma::Coherent cannot safely provide (mutable) access to its
underlying memory because the memory might be concurrently accessed by a
DMA device. This makes it difficult to safely initialize the memory
before handing it over to the hardware.

Introduce dma::CoherentBox, a type that encapsulates a dma::Coherent
before its DMA address is exposed to the device. dma::CoherentBox can
guarantee exclusive access to the inner dma::Coherent and implement
Deref and DerefMut.

Once the memory is properly initialized, dma::CoherentBox can be
converted into a regular dma::Coherent.

Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Reviewed-by: Gary Guo <gary@garyguo.net>
Reviewed-by: Alexandre Courbot <acourbot@nvidia.com>
Link: https://patch.msgid.link/20260320194626.36263-5-dakr@kernel.org
[ Remove unnecessary trait bounds. - Danilo ]
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
2026-03-23 22:35:38 +01:00
..
2025-10-20 04:04:23 +02:00
2025-11-05 00:05:38 +01:00
2025-11-29 10:41:09 -08:00
2026-03-17 20:04:11 +01:00
2025-11-04 13:25:29 +01:00
2025-07-23 02:05:58 +02:00
2026-03-10 16:07:33 +09:00
2025-09-06 13:27:20 +02:00
2026-02-01 22:18:24 +01:00
2026-01-30 05:47:05 +01:00
2025-08-21 16:58:07 +02:00
2025-12-28 12:43:56 +01:00
2024-11-04 16:21:44 -05:00