Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1681680

Re: [PATCH v3 0/2] [media] videobuf2-dc: Add support for cacheable MMAP

From Christoph Hellwig <hch@lst.de>
Newsgroups linux.kernel
Subject Re: [PATCH v3 0/2] [media] videobuf2-dc: Add support for cacheable MMAP
Date 2017-07-05 19:40 +0200
Message-ID <tZWro-Q4-15@gated-at.bofh.it> (permalink)
References <tZ5Q7-7za-33@gated-at.bofh.it> <swsdY-1ge-19@gated-at.bofh.it> <tZ5Q7-7za-31@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Mon, Jul 03, 2017 at 11:27:32AM +0200, Marek Szyprowski wrote:
> The main question here if we want to merge incomplete solution or not. As
> for now, there is no support in ARM/ARM64 for NON_CONSISTENT attribute.
> Also none of the v4l2 drivers use it. Sadly support for NON_CONSISTENT
> attribute is not fully implemented nor even defined in mainline.
>

DMA_ATTR_NON_CONSISTENT is the way to get the dma_alloc_noncoherent
semantics through the dma_alloc_attr API, and as such I think it is
pretty well defined, although the documentation in
Documentation/DMA-attributes.txt is really bad and we need to improve
it, by merging it with the dma_alloc_noncoherent description in
Documentation/DMA-API.txt. My series to remove dma_alloc_noncoherent
updates the latter to mention DMA_ATTR_NON_CONSISTENT, but
we should probably merge Documentation/DMA-API.txt,
Documentation/DMA-attributes.txt and Documentation/DMA-API-HOWTO.txt
into a single coherent document.


> I know that it works fine for some vendor kernel trees, but supporting it in
> mainline was a bit controversial. There is no proper way to sync cache for 
> such
> buffers. Calling dma_sync_sg worked so far, but it has to be first agreed as
> a proper DMA API.

As documented in Documentation/DMA-API.txt the proper way to sync
noncoherent/nonconsistent regions is to call dma_cache_sync.  It seems
like it generally is the same as dma_sync_range/sg so if we could
eventually merge these APIs that should reduce the confusion further.

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Re: [PATCH v3 0/2] [media] videobuf2-dc: Add support for cacheable         MMAP Christoph Hellwig <hch@lst.de> - 2017-07-05 19:40 +0200
  Re: [PATCH v3 0/2] [media] videobuf2-dc: Add support for cacheable MMAP Marek Szyprowski <m.szyprowski@samsung.com> - 2017-07-13 13:20 +0200
    Re: [PATCH v3 0/2] [media] videobuf2-dc: Add support for cacheable  MMAP Russell King - ARM Linux <linux@armlinux.org.uk> - 2017-07-13 15:30 +0200
      Re: [PATCH v3 0/2] [media] videobuf2-dc: Add support for cacheable         MMAP Christoph Hellwig <hch@lst.de> - 2017-07-13 15:40 +0200

csiph-web