From: "Danilo Krummrich" <dakr@kernel.org>
To: "Beata Michalska" <beata.michalska@arm.com>
Cc: <ojeda@kernel.org>, <rust-for-linux@vger.kernel.org>,
<abdiel.janulgue@gmail.com>, <daniel.almeida@collabora.com>,
<aliceryhl@google.com>, <robin.murphy@arm.com>,
<a.hindborg@kernel.org>, <boqun.feng@gmail.com>,
<gary@garyguo.net>, <bjorn3_gh@protonmail.com>,
<lossin@kernel.org>, <tmgross@umich.edu>,
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] rust: dma: allow drivers to tune max segment size
Date: Fri, 23 Jan 2026 11:40:47 +0100 [thread overview]
Message-ID: <DFVWLIUK193C.EAXZYN4JKZVH@kernel.org> (raw)
In-Reply-To: <20260123101832.3136897-1-beata.michalska@arm.com>
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
next prev parent reply other threads:[~2026-01-23 10:40 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-23 10:18 [PATCH] rust: dma: allow drivers to tune max segment size Beata Michalska
2026-01-23 10:40 ` Danilo Krummrich [this message]
2026-01-23 13:22 ` Beata Michalska
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=DFVWLIUK193C.EAXZYN4JKZVH@kernel.org \
--to=dakr@kernel.org \
--cc=a.hindborg@kernel.org \
--cc=abdiel.janulgue@gmail.com \
--cc=aliceryhl@google.com \
--cc=beata.michalska@arm.com \
--cc=bjorn3_gh@protonmail.com \
--cc=boqun.feng@gmail.com \
--cc=daniel.almeida@collabora.com \
--cc=gary@garyguo.net \
--cc=linux-kernel@vger.kernel.org \
--cc=lossin@kernel.org \
--cc=ojeda@kernel.org \
--cc=robin.murphy@arm.com \
--cc=rust-for-linux@vger.kernel.org \
--cc=tmgross@umich.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.