[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9a71bf2e-0818-4567-81fa-95b1a4173939@nvidia.com>
Date: Fri, 11 Jul 2025 19:40:00 -0400
From: Joel Fernandes <joelagnelf@...dia.com>
To: Danilo Krummrich <dakr@...nel.org>
Cc: 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, lossin@...nel.org, aliceryhl@...gle.com,
tmgross@...ch.edu, bhelgaas@...gle.com, kwilczynski@...nel.org,
gregkh@...uxfoundation.org, rafael@...nel.org,
rust-for-linux@...r.kernel.org, linux-pci@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/5] rust: dma: add DMA addressing capabilities
On 7/11/2025 3:54 PM, Danilo Krummrich wrote:
> On Fri Jul 11, 2025 at 9:35 PM CEST, Joel Fernandes wrote:
>> It looks good to me. A few high-level comments:
>>
>> 1. If we don't expect the concurrency issue for this in C code, why do we
>> expect it to happen in rust?
>
> The race can happen in C as well, but people would probably argue that no one
> ever calls the mask setter function concurrently to DMA allocation and mapping
> primitives.
>
After going through the DMA code some more, I am convinced the concurrency is an
issue so marking the higher-level rust wrapper as unsafe { } makes sense.
Thanks Danilo for the discussion and Miguel also for the clarifications on the
other thread.
- Joel
Powered by blists - more mailing lists