[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20250411.192647.1837707035806943183.fujita.tomonori@gmail.com>
Date: Fri, 11 Apr 2025 19:26:47 +0900 (JST)
From: FUJITA Tomonori <fujita.tomonori@...il.com>
To: dakr@...nel.org
Cc: fujita.tomonori@...il.com, rust-for-linux@...r.kernel.org,
abdiel.janulgue@...il.com, daniel.almeida@...labora.com,
robin.murphy@....com, a.hindborg@...nel.org, ojeda@...nel.org,
alex.gaynor@...il.com, boqun.feng@...il.com, gary@...yguo.net,
bjorn3_gh@...tonmail.com, benno.lossin@...ton.me, aliceryhl@...gle.com,
tmgross@...ch.edu, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] rust: helpers: Add dma_alloc_attrs() and
dma_free_attrs()
On Fri, 11 Apr 2025 11:51:03 +0200
Danilo Krummrich <dakr@...nel.org> wrote:
> On Fri, Apr 11, 2025 at 08:43:32AM +0900, FUJITA Tomonori wrote:
>> Add dma_alloc_attrs() and dma_free_attrs() helpers to fix a build
>> error when CONFIG_HAS_DMA is not enabled.
>>
>> Note that when CONFIG_HAS_DMA is enabled, dma_alloc_attrs() and
>> dma_free_attrs() are included in both bindings_generated.rs and
>> bindings_helpers_generated.rs. The former takes precedence so behavior
>> remains unchanged in that case.
>>
>> This fixes the following build error on UML:
>>
>> error[E0425]: cannot find function `dma_alloc_attrs` in crate `bindings`
>> --> rust/kernel/dma.rs:171:23
>> |
>> 171 | bindings::dma_alloc_attrs(
>> | ^^^^^^^^^^^^^^^ help: a function with a similar name exists: `dma_alloc_pages`
>> |
>> ::: /home/fujita/build/um/rust/bindings/bindings_generated.rs:44568:5
>> |
>> 44568 | / pub fn dma_alloc_pages(
>> 44569 | | dev: *mut device,
>> 44570 | | size: usize,
>> 44571 | | dma_handle: *mut dma_addr_t,
>> 44572 | | dir: dma_data_direction,
>> 44573 | | gfp: gfp_t,
>> 44574 | | ) -> *mut page;
>> | |___________________- similarly named function `dma_alloc_pages` defined here
>>
>> error[E0425]: cannot find function `dma_free_attrs` in crate `bindings`
>> --> rust/kernel/dma.rs:293:23
>> |
>> 293 | bindings::dma_free_attrs(
>> | ^^^^^^^^^^^^^^ help: a function with a similar name exists: `dma_free_pages`
>> |
>> ::: /home/fujita/build/um/rust/bindings/bindings_generated.rs:44577:5
>> |
>> 44577 | / pub fn dma_free_pages(
>> 44578 | | dev: *mut device,
>> 44579 | | size: usize,
>> 44580 | | page: *mut page,
>> 44581 | | dma_handle: dma_addr_t,
>> 44582 | | dir: dma_data_direction,
>> 44583 | | );
>> | |______- similarly named function `dma_free_pages` defined here
>>
>> Fixes: ad2907b4e308 ("rust: add dma coherent allocator abstraction")
>> Signed-off-by: FUJITA Tomonori <fujita.tomonori@...il.com>
>
> Please add the new file to the corresponding MAINTAINERS entry. Whith that,
>
> Acked-by: Danilo Krummrich <dakr@...nel.org>
I'll include the following changes in the next version.
diff --git a/MAINTAINERS b/MAINTAINERS
index 96b827049501..bec614ef35d9 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -7020,6 +7020,7 @@ L: rust-for-linux@...r.kernel.org
S: Supported
W: https://rust-for-linux.com
T: git https://github.com/Rust-for-Linux/linux.git alloc-next
+F: rust/helpers/dma.c
F: rust/kernel/dma.rs
F: samples/rust/rust_dma.rs
Powered by blists - more mailing lists