[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <DFVWLIUK193C.EAXZYN4JKZVH@kernel.org>
Date: Fri, 23 Jan 2026 11:40:47 +0100
From: "Danilo Krummrich" <dakr@...nel.org>
To: "Beata Michalska" <beata.michalska@....com>
Cc: <ojeda@...nel.org>, <rust-for-linux@...r.kernel.org>,
<abdiel.janulgue@...il.com>, <daniel.almeida@...labora.com>,
<aliceryhl@...gle.com>, <robin.murphy@....com>, <a.hindborg@...nel.org>,
<boqun.feng@...il.com>, <gary@...yguo.net>, <bjorn3_gh@...tonmail.com>,
<lossin@...nel.org>, <tmgross@...ch.edu>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] rust: dma: allow drivers to tune max segment size
On Fri Jan 23, 2026 at 11:18 AM CET, Beata Michalska wrote:
> + /// Set the maximum size of a single DMA segment the device may request.
> + ///
> + /// This method is usually called once from `probe()` as soon as the device capabilities are
> + /// known.
> + ///
> + /// # Safety
> + ///
> + /// This method must not be called if there are any in-flight DMA allocation
> + /// or mapping operations.
Yes, unfortunately it has the same requirements as the DMA mask setters.
For consistency, can you please use the exact same safety requirement text as
the other methods?
> + unsafe fn dma_set_max_seg_size(&self, size: u32) {
> + // SAFETY:
> + // - By the type invariant of `device::Device`, `self.as_ref().as_raw()` is valid.
> + // - The safety requirement of this function guarantees that there are no concurrent calls
> + // to DMA allocation and mapping operations relying on this parameter.
> + unsafe { bindings::dma_set_max_seg_size(self.as_ref().as_raw(), size) }
> + }
> }
>
> /// A DMA mask that holds a bitmask with the lowest `n` bits set.
> --
> 2.25.1
Powered by blists - more mailing lists