Skip to content

Commit 9863f77

Browse files
xyn-ackDanilo Krummrich
authored andcommitted
rust: dma: clarify wording and be consistent in coherent nomenclature
In the kernel, `consistent` and `coherent` are used interchangeably for the region described in this api. Stick with `coherent` nomenclature to show that dma_alloc_coherent() is being used, in addition to improving the clarity in the DMA mapping attributes documentation. Reviewed-by: Benno Lossin <benno.lossin@proton.me> Signed-off-by: Abdiel Janulgue <abdiel.janulgue@gmail.com> Reviewed-by: Andreas Hindborg <a.hindborg@kernel.org> Link: https://lore.kernel.org/r/20250602085444.1925053-2-abdiel.janulgue@gmail.com Signed-off-by: Danilo Krummrich <dakr@kernel.org>
1 parent 19272b3 commit 9863f77

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

rust/kernel/dma.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,23 +89,23 @@ pub mod attrs {
8989
/// Forces contiguous allocation of the buffer in physical memory.
9090
pub const DMA_ATTR_FORCE_CONTIGUOUS: Attrs = Attrs(bindings::DMA_ATTR_FORCE_CONTIGUOUS);
9191

92-
/// This is a hint to the DMA-mapping subsystem that it's probably not worth the time to try
92+
/// Hints DMA-mapping subsystem that it's probably not worth the time to try
9393
/// to allocate memory to in a way that gives better TLB efficiency.
9494
pub const DMA_ATTR_ALLOC_SINGLE_PAGES: Attrs = Attrs(bindings::DMA_ATTR_ALLOC_SINGLE_PAGES);
9595

9696
/// This tells the DMA-mapping subsystem to suppress allocation failure reports (similarly to
9797
/// `__GFP_NOWARN`).
9898
pub const DMA_ATTR_NO_WARN: Attrs = Attrs(bindings::DMA_ATTR_NO_WARN);
9999

100-
/// Used to indicate that the buffer is fully accessible at an elevated privilege level (and
100+
/// Indicates that the buffer is fully accessible at an elevated privilege level (and
101101
/// ideally inaccessible or at least read-only at lesser-privileged levels).
102102
pub const DMA_ATTR_PRIVILEGED: Attrs = Attrs(bindings::DMA_ATTR_PRIVILEGED);
103103
}
104104

105105
/// An abstraction of the `dma_alloc_coherent` API.
106106
///
107107
/// This is an abstraction around the `dma_alloc_coherent` API which is used to allocate and map
108-
/// large consistent DMA regions.
108+
/// large coherent DMA regions.
109109
///
110110
/// A [`CoherentAllocation`] instance contains a pointer to the allocated region (in the
111111
/// processor's virtual address space) and the device address which can be given to the device
@@ -115,7 +115,7 @@ pub mod attrs {
115115
/// # Invariants
116116
///
117117
/// For the lifetime of an instance of [`CoherentAllocation`], the `cpu_addr` is a valid pointer
118-
/// to an allocated region of consistent memory and `dma_handle` is the DMA address base of
118+
/// to an allocated region of coherent memory and `dma_handle` is the DMA address base of
119119
/// the region.
120120
// TODO
121121
//
@@ -138,7 +138,7 @@ pub struct CoherentAllocation<T: AsBytes + FromBytes> {
138138
}
139139

140140
impl<T: AsBytes + FromBytes> CoherentAllocation<T> {
141-
/// Allocates a region of `size_of::<T> * count` of consistent memory.
141+
/// Allocates a region of `size_of::<T> * count` of coherent memory.
142142
///
143143
/// # Examples
144144
///

0 commit comments

Comments
 (0)