[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aCJVn4LCCoe35SrU@cassiopeiae>
Date: Mon, 12 May 2025 22:10:07 +0200
From: Danilo Krummrich <dakr@...nel.org>
To: Daniel Almeida <daniel.almeida@...labora.com>
Cc: Jason Gunthorpe <jgg@...pe.ca>,
Abdiel Janulgue <abdiel.janulgue@...il.com>, lyude@...hat.com,
Miguel Ojeda <ojeda@...nel.org>,
Alex Gaynor <alex.gaynor@...il.com>,
Boqun Feng <boqun.feng@...il.com>, Gary Guo <gary@...yguo.net>,
Björn Roy Baron <bjorn3_gh@...tonmail.com>,
Benno Lossin <benno.lossin@...ton.me>,
Andreas Hindborg <a.hindborg@...nel.org>,
Alice Ryhl <aliceryhl@...gle.com>, Trevor Gross <tmgross@...ch.edu>,
Valentin Obst <kernel@...entinobst.de>,
open list <linux-kernel@...r.kernel.org>,
Marek Szyprowski <m.szyprowski@...sung.com>,
Robin Murphy <robin.murphy@....com>, airlied@...hat.com,
rust-for-linux@...r.kernel.org,
"open list:DMA MAPPING HELPERS" <iommu@...ts.linux.dev>,
Petr Tesarik <petr@...arici.cz>,
Andrew Morton <akpm@...ux-foundation.org>,
Herbert Xu <herbert@...dor.apana.org.au>,
Sui Jingfeng <sui.jingfeng@...ux.dev>,
Randy Dunlap <rdunlap@...radead.org>,
Michael Kelley <mhklinux@...look.com>
Subject: Re: [RFC PATCH 1/2] rust: add initial scatterlist bindings
On Mon, May 12, 2025 at 05:01:45PM -0300, Daniel Almeida wrote:
> Hi Jason,
>
> >> +
> >> + /// Map this scatter-gather table describing a buffer for DMA.
> >> + pub fn dma_map(&mut self, dir: DmaDataDirection) -> Result {
> >> + // SAFETY: Invariants on `Device` and `SGTable` ensures that the `self.dev` and `self.sg`
> >> + // pointers are valid.
> >> + let ret = unsafe {
> >> + bindings::dma_map_sgtable(
> >> + self.dev.as_raw(),
> >> + self.sg.as_raw(),
> >
> > Can't call this function on an unbound driver, didn't someone add
> > special types for this recently?
>
> JFYI: I think that the “Bound” state is still WIP and not upstream yet.
It's in driver-core-next and queued up for v6.16.
There's also a signed tag [1] that can be merged into other trees, such that
this can be used right away.
- Danilo
[1] https://git.kernel.org/pub/scm/linux/kernel/git/driver-core/driver-core.git/tag/?h=topic/device-context-2025-04-17
Powered by blists - more mailing lists