[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAF6AEGuM1+pimGNhyKHbYR0BdH=hH+Sai0es8RjGHE9jKHjngw@mail.gmail.com>
Date: Tue, 23 Jul 2019 13:09:55 -0700
From: Rob Clark <robdclark@...il.com>
To: John Stultz <john.stultz@...aro.org>
Cc: Christoph Hellwig <hch@...radead.org>,
lkml <linux-kernel@...r.kernel.org>,
Laura Abbott <labbott@...hat.com>,
Benjamin Gaignard <benjamin.gaignard@...aro.org>,
Sumit Semwal <sumit.semwal@...aro.org>,
Liam Mark <lmark@...eaurora.org>,
Pratik Patel <pratikp@...eaurora.org>,
Brian Starkey <Brian.Starkey@....com>,
Vincent Donnefort <Vincent.Donnefort@....com>,
Sudipto Paul <Sudipto.Paul@....com>,
"Andrew F . Davis" <afd@...com>,
Xu YiPing <xuyiping@...ilicon.com>,
"Chenfeng (puck)" <puck.chen@...ilicon.com>,
butao <butao@...ilicon.com>,
"Xiaqing (A)" <saberlily.xia@...ilicon.com>,
Yudongbin <yudongbin@...ilicon.com>,
Chenbo Feng <fengc@...gle.com>,
Alistair Strachan <astrachan@...gle.com>,
dri-devel <dri-devel@...ts.freedesktop.org>,
Hridya Valsaraju <hridya@...gle.com>
Subject: Re: [PATCH v6 2/5] dma-buf: heaps: Add heap helpers
On Mon, Jul 22, 2019 at 9:09 PM John Stultz <john.stultz@...aro.org> wrote:
>
> On Thu, Jul 18, 2019 at 3:06 AM Christoph Hellwig <hch@...radead.org> wrote:
> >
> > Is there any exlusion between mmap / vmap and the device accessing
> > the data? Without that you are going to run into a lot of coherency
> > problems.
dma_fence is basically the way to handle exclusion between different
device access (since device access tends to be asynchronous). For
device<->device access, each driver is expected to take care of any
cache(s) that the device might have. (Ie. device writing to buffer
should flush it's caches if needed before signalling fence to let
reading device know that it is safe to read, etc.)
_begin/end_cpu_access() is intended to be the exclusion for CPU access
(which is synchronous)
BR,
-R
> This has actually been a concern of mine recently, but at the higher
> dma-buf core level. Conceptually, there is the
> dma_buf_map_attachment() and dma_buf_unmap_attachment() calls drivers
> use to map the buffer to an attached device, and there are the
> dma_buf_begin_cpu_access() and dma_buf_end_cpu_access() calls which
> are to be done when touching the cpu mapped pages. These look like
> serializing functions, but actually don't seem to have any enforcement
> mechanism to exclude parallel access.
>
> To me it seems like adding the exclusion between those operations
> should be done at the dmabuf core level, and would actually be helpful
> for optimizing some of the cache maintenance rules w/ dmabuf. Does
> this sound like something closer to what your suggesting, or am I
> misunderstanding your point?
>
> Again, I really appreciate the review and feedback!
>
> Thanks so much!
> -john
Powered by blists - more mailing lists