[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <DFW4F5OSDO7A.TBUOX6RCN8G7@garyguo.net>
Date: Fri, 23 Jan 2026 16:48:37 +0000
From: "Gary Guo" <gary@...yguo.net>
To: "Dirk Behme" <dirk.behme@...il.com>, "Beata Michalska"
<beata.michalska@....com>, <dakr@...nel.org>, <ojeda@...nel.org>,
<rust-for-linux@...r.kernel.org>
Cc: <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 v2] rust: dma: allow drivers to tune max segment size
On Fri Jan 23, 2026 at 4:39 PM GMT, Dirk Behme wrote:
> On 23.01.26 14:13, Beata Michalska wrote:
>> Make dma_set_max_seg_size() available to Rust so drivers can perform
>> standard DMA setup steps.
>>
>> Signed-off-by: Beata Michalska <beata.michalska@....com>
>> ---
>>
>> v2:
>> - Aligned safety requirements
>>
>> rust/helpers/dma.c | 5 +++++
>> rust/kernel/dma.rs | 17 +++++++++++++++++
>> 2 files changed, 22 insertions(+)
>>
>> diff --git a/rust/helpers/dma.c b/rust/helpers/dma.c
>> index 2afa32c21c94..220b9308830f 100644
>> --- a/rust/helpers/dma.c
>> +++ b/rust/helpers/dma.c
>> @@ -40,3 +40,8 @@ size_t rust_helper_dma_max_mapping_size(struct device *dev)
>> {
>> return dma_max_mapping_size(dev);
>> }
>> +
>> +void rust_helper_dma_set_max_seg_size(struct device *dev, unsigned int size)
>> +{
>> + dma_set_max_seg_size(dev, size);
>> +}
>
> I was about to ask "please add __rust_helper" [1]. But looking into
> driver-core-next it looks like some of the function in dma.c have
> __rust_helper (from [1]) and some don't (from [2]). Is this by
> intention or was this an omission in [2]?
This is an omission. It's an also a relatively new addition which means that
it's not covered in Alice's series.
Best,
Gary
Powered by blists - more mailing lists