Re: [RFC PATCH] rust: sync: Add dma_fence abstractions

From: Danilo Krummrich

Date: Sun Sep 28 2025 - 11:21:07 EST


On Fri Sep 26, 2025 at 6:10 PM CEST, Boqun Feng wrote:
> I missed this part, and I don't think kernel::sync is where dma_fence
> should be, as kernel::sync is mostly for the basic synchronization
> between threads/irqs. dma_fence is probably better to be grouped with
> dma-buf and other dma related primitives. Maybe in kernel::dma? Like:

I agree, kernel::sync may be a bit misleading.

> rust/kernel/dma.rs
> rust/kernel/dma/dma_buf.rs
> rust/kernel/dma/dma_fence.rs
>
> Thoughts? Miguel, Greg, Danilo and Lyude, any idea or suggestion?

To me it depends on if we want to maintain the code under a global
DMA MAPPING & SCATTERLIST API entry or if it will just be added to the
DMA BUFFER SHARING FRAMEWORK entry.

In case of the latter I'd go for rust/kernel/dma-buf/, analogous to
drivers/dma-buf/. (Though, I'm not sure why this is under drivers/, there's
nothing like dma-buf drivers; I think kernel/dma/ would have been the better
fit.)

In any case, the target tree would probably be the drm-rust tree.