[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ecf3752d-87ab-4b3b-8660-d827437b0ffb@gmail.com>
Date: Mon, 17 Feb 2025 19:37:43 +0200
From: Abdiel Janulgue <abdiel.janulgue@...il.com>
To: Robin Murphy <robin.murphy@....com>,
Daniel Almeida <daniel.almeida@...labora.com>
Cc: rust-for-linux@...r.kernel.org, dakr@...nel.org, aliceryhl@...gle.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>, Trevor Gross <tmgross@...ch.edu>,
Valentin Obst <kernel@...entinobst.de>,
open list <linux-kernel@...r.kernel.org>, Christoph Hellwig <hch@....de>,
Marek Szyprowski <m.szyprowski@...sung.com>, airlied@...hat.com,
"open list:DMA MAPPING HELPERS" <iommu@...ts.linux.dev>
Subject: Re: [PATCH v11 2/3] rust: add dma coherent allocator abstraction.
On 17/02/2025 15:52, Robin Murphy wrote:
> On 15/02/2025 9:40 pm, Daniel Almeida wrote:
>> Hi Abdiel
>>
>> I noticed that there’s no API to call `dma_set_mask/
>> dma_set_coherent_mask`.
>>
>> This should probably be included, i.e.:
>>
>> ```
>> By default, the kernel assumes that your device can address 32-bits of
>> DMA addressing.
>> For a 64-bit capable device, this needs to be increased, and for a
>> device with limitations,
>> it needs to be decreased.
>> ```
>
> Oh, good point (and I'm rather ashamed I missed that!)
Ok. Missed this part while working on the nova stub and hadn't had to
use this interface yet, but yes will add this for the next revision.
>
> FWIW we've been wanting to steer away from relying on the default mask
> in new code, so it would be quite neat to actually enforce that
> allocations fail if dma_coherent_mask hasn't been explicitly set
> (assuming it's sufficiently cheap to keep a flag in the Device handle or
> something like that - it's not the end of the world if it isn't practical).
>
Thanks for the heads-up on what this interface is expected to look like!
Regards,
Abdiel
Powered by blists - more mailing lists