From: Marek Szyprowski <m.szyprowski@samsung.com>
To: 'Arnd Bergmann' <arnd@arndb.de>
Cc: linux-arch@vger.kernel.org,
'Russell King - ARM Linux' <linux@arm.linux.org.uk>,
'Joerg Roedel' <joro@8bytes.org>,
linaro-mm-sig@lists.linaro.org, linux-mm@kvack.org,
'Kyungmin Park' <kyungmin.park@samsung.com>,
linux-arm-kernel@lists.infradead.org
Subject: RE: [PATCH 7/8] common: dma-mapping: change alloc/free_coherent method to more generic alloc/free_attrs
Date: Mon, 27 Jun 2011 14:23:40 +0200 [thread overview]
Message-ID: <000701cc34c5$0c50b800$24f22800$%szyprowski@samsung.com> (raw)
In-Reply-To: <201106241751.35655.arnd@arndb.de>
Hello,
On Friday, June 24, 2011 5:52 PM Arnd Bergmann wrote:
> On Monday 20 June 2011, Marek Szyprowski wrote:
> > Introduce new alloc/free/mmap methods that take attributes argument.
> > alloc/free_coherent can be implemented on top of the new alloc/free
> > calls with NULL attributes. dma_alloc_non_coherent can be implemented
> > using DMA_ATTR_NONCOHERENT attribute, dma_alloc_writecombine can also
> > use separate DMA_ATTR_WRITECOMBINE attribute. This way the drivers will
> > get more generic, platform independent way of allocating dma memory
> > buffers with specific parameters.
> >
> > One more attribute can be usefull: DMA_ATTR_NOKERNELVADDR. Buffers with
> > such attribute will not have valid kernel virtual address. They might be
> > usefull for drivers that only exports the DMA buffers to userspace (like
> > for example V4L2 or ALSA).
> >
> > mmap method is introduced to let the drivers create a user space mapping
> > for a DMA buffer in generic, architecture independent way.
> >
> > TODO: update all dma_map_ops clients for all architectures
> >
> > Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
> > Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
>
> Yes, I think that is good, but the change needs to be done atomically
> across all architectures.
Yes, I'm aware of this and I will include such changes in the next version
of my patches.
> This should be easy enough as I believe
> all other architectures that use dma_map_ops don't even require
> dma_alloc_noncoherent but just define it to dma_alloc_coherent
> because they have only coherent memory in regular device drivers.
Right, this should be quite simple. I will also add DMA_ATTR_NON_COHERENT
attribute for implementing dma_alloc_noncoherent() call.
> On a related note, do you plan to make the CMA work use this
> transparently, or do you want to have a DMA_ATTR_LARGE or
> DMA_ATTR_CONTIGUOUS for CMA?
IMHO it will be better to hide the CMA from the drivers. Memory allocated
from CMA doesn't really differ from the one allocated by dma_alloc_coherent()
(which internally use alloc_pages()), so I really see no reason for adding
additional attribute for it.
Best regards
--
Marek Szyprowski
Samsung Poland R&D Center
WARNING: multiple messages have this Message-ID (diff)
From: Marek Szyprowski <m.szyprowski@samsung.com>
To: 'Arnd Bergmann' <arnd@arndb.de>
Cc: linux-arm-kernel@lists.infradead.org,
linaro-mm-sig@lists.linaro.org, linux-mm@kvack.org,
linux-arch@vger.kernel.org,
'Kyungmin Park' <kyungmin.park@samsung.com>,
'Joerg Roedel' <joro@8bytes.org>,
'Russell King - ARM Linux' <linux@arm.linux.org.uk>
Subject: RE: [PATCH 7/8] common: dma-mapping: change alloc/free_coherent method to more generic alloc/free_attrs
Date: Mon, 27 Jun 2011 14:23:40 +0200 [thread overview]
Message-ID: <000701cc34c5$0c50b800$24f22800$%szyprowski@samsung.com> (raw)
Message-ID: <20110627122340.DWBHnGxCUIOqpSvA9lx_5vqbFx6yBQiZdc8usC6x7oM@z> (raw)
In-Reply-To: <201106241751.35655.arnd@arndb.de>
Hello,
On Friday, June 24, 2011 5:52 PM Arnd Bergmann wrote:
> On Monday 20 June 2011, Marek Szyprowski wrote:
> > Introduce new alloc/free/mmap methods that take attributes argument.
> > alloc/free_coherent can be implemented on top of the new alloc/free
> > calls with NULL attributes. dma_alloc_non_coherent can be implemented
> > using DMA_ATTR_NONCOHERENT attribute, dma_alloc_writecombine can also
> > use separate DMA_ATTR_WRITECOMBINE attribute. This way the drivers will
> > get more generic, platform independent way of allocating dma memory
> > buffers with specific parameters.
> >
> > One more attribute can be usefull: DMA_ATTR_NOKERNELVADDR. Buffers with
> > such attribute will not have valid kernel virtual address. They might be
> > usefull for drivers that only exports the DMA buffers to userspace (like
> > for example V4L2 or ALSA).
> >
> > mmap method is introduced to let the drivers create a user space mapping
> > for a DMA buffer in generic, architecture independent way.
> >
> > TODO: update all dma_map_ops clients for all architectures
> >
> > Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
> > Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
>
> Yes, I think that is good, but the change needs to be done atomically
> across all architectures.
Yes, I'm aware of this and I will include such changes in the next version
of my patches.
> This should be easy enough as I believe
> all other architectures that use dma_map_ops don't even require
> dma_alloc_noncoherent but just define it to dma_alloc_coherent
> because they have only coherent memory in regular device drivers.
Right, this should be quite simple. I will also add DMA_ATTR_NON_COHERENT
attribute for implementing dma_alloc_noncoherent() call.
> On a related note, do you plan to make the CMA work use this
> transparently, or do you want to have a DMA_ATTR_LARGE or
> DMA_ATTR_CONTIGUOUS for CMA?
IMHO it will be better to hide the CMA from the drivers. Memory allocated
from CMA doesn't really differ from the one allocated by dma_alloc_coherent()
(which internally use alloc_pages()), so I really see no reason for adding
additional attribute for it.
Best regards
--
Marek Szyprowski
Samsung Poland R&D Center
next prev parent reply other threads:[~2011-06-27 12:23 UTC|newest]
Thread overview: 94+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-20 7:50 [PATCH/RFC 0/8] ARM: DMA-mapping framework redesign Marek Szyprowski
2011-06-20 7:50 ` [PATCH 1/8] ARM: dma-mapping: remove offset parameter to prepare for generic dma_ops Marek Szyprowski
2011-06-20 8:35 ` Michal Nazarewicz
2011-06-20 10:46 ` Marek Szyprowski
2011-06-20 10:46 ` Marek Szyprowski
2011-07-03 15:28 ` Russell King - ARM Linux
2011-07-03 15:28 ` Russell King - ARM Linux
2011-07-26 12:56 ` Marek Szyprowski
2011-06-20 7:50 ` [PATCH 2/8] ARM: dma-mapping: implement dma_map_single on top of dma_map_page Marek Szyprowski
2011-06-20 14:39 ` Russell King - ARM Linux
2011-06-20 14:39 ` Russell King - ARM Linux
2011-06-20 15:15 ` Marek Szyprowski
2011-06-24 15:24 ` Arnd Bergmann
2011-06-24 15:24 ` Arnd Bergmann
2011-06-27 14:29 ` Marek Szyprowski
2011-06-27 14:53 ` Arnd Bergmann
2011-06-27 14:53 ` Arnd Bergmann
2011-06-27 15:06 ` Marek Szyprowski
2011-06-20 7:50 ` [PATCH 3/8] ARM: dma-mapping: use asm-generic/dma-mapping-common.h Marek Szyprowski
2011-06-20 14:33 ` [Linaro-mm-sig] " KyongHo Cho
2011-06-21 11:47 ` Marek Szyprowski
2011-06-21 11:47 ` Marek Szyprowski
2011-06-24 8:39 ` 'Joerg Roedel'
2011-06-24 8:39 ` 'Joerg Roedel'
2011-06-24 15:36 ` Arnd Bergmann
2011-06-24 15:36 ` Arnd Bergmann
2011-06-27 12:18 ` Marek Szyprowski
2011-06-27 12:18 ` Marek Szyprowski
2011-06-27 13:19 ` Arnd Bergmann
2011-06-27 13:19 ` Arnd Bergmann
2011-07-07 12:09 ` Lennert Buytenhek
2011-07-07 12:09 ` Lennert Buytenhek
2011-07-07 12:38 ` Russell King - ARM Linux
2011-07-07 12:38 ` Russell King - ARM Linux
2011-07-15 0:10 ` Lennert Buytenhek
2011-07-15 9:27 ` Russell King - ARM Linux
2011-07-15 9:27 ` Russell King - ARM Linux
2011-07-15 21:53 ` Lennert Buytenhek
2011-06-20 7:50 ` [PATCH 4/8] ARM: dma-mapping: implement dma sg methods on top of generic dma ops Marek Szyprowski
2011-06-20 7:50 ` Marek Szyprowski
2011-06-20 14:37 ` KyongHo Cho
2011-06-20 14:40 ` Russell King - ARM Linux
2011-06-20 14:40 ` Russell King - ARM Linux
2011-06-20 15:23 ` Marek Szyprowski
2011-06-20 7:50 ` [PATCH 5/8] ARM: dma-mapping: move all dma bounce code to separate dma ops structure Marek Szyprowski
2011-06-20 14:42 ` Russell King - ARM Linux
2011-06-20 15:31 ` Marek Szyprowski
2011-06-20 15:31 ` Marek Szyprowski
2011-06-24 15:47 ` Arnd Bergmann
2011-06-24 15:47 ` Arnd Bergmann
2011-06-27 14:20 ` Marek Szyprowski
2011-06-27 14:20 ` Marek Szyprowski
2011-06-20 7:50 ` [PATCH 6/8] ARM: dma-mapping: remove redundant code and cleanup Marek Szyprowski
2011-06-20 7:50 ` [PATCH 7/8] common: dma-mapping: change alloc/free_coherent method to more generic alloc/free_attrs Marek Szyprowski
2011-06-20 14:45 ` KyongHo Cho
2011-06-20 15:06 ` Russell King - ARM Linux
2011-06-20 15:06 ` Russell King - ARM Linux
2011-06-20 15:14 ` [Linaro-mm-sig] " KyongHo Cho
2011-06-21 11:23 ` Marek Szyprowski
2011-06-22 0:00 ` [Linaro-mm-sig] " KyongHo Cho
2011-06-24 7:20 ` Marek Szyprowski
2011-06-24 15:51 ` Arnd Bergmann
2011-06-24 15:51 ` Arnd Bergmann
2011-06-24 16:15 ` James Bottomley
2011-06-24 16:23 ` Arnd Bergmann
2011-06-27 12:23 ` Marek Szyprowski [this message]
2011-06-27 12:23 ` Marek Szyprowski
2011-06-27 13:22 ` Arnd Bergmann
2011-06-27 13:22 ` Arnd Bergmann
2011-06-27 13:30 ` Marek Szyprowski
2011-06-27 13:30 ` Marek Szyprowski
2011-06-24 15:53 ` Arnd Bergmann
2011-06-24 15:53 ` Arnd Bergmann
2011-06-27 14:41 ` Marek Szyprowski
2011-06-20 7:50 ` [PATCH 8/8] ARM: dma-mapping: use alloc, mmap, free from dma_ops Marek Szyprowski
2011-06-22 6:53 ` [Linaro-mm-sig] " KyongHo Cho
2011-06-22 4:53 ` [Linaro-mm-sig] [PATCH/RFC 0/8] ARM: DMA-mapping framework redesign Subash Patel
2011-06-22 6:59 ` Marek Szyprowski
2011-06-22 6:59 ` Marek Szyprowski
2011-06-22 8:53 ` Subash Patel
2011-06-22 9:27 ` Marek Szyprowski
2011-06-22 16:00 ` Jordan Crouse
2011-06-23 13:09 ` Subash Patel
2011-06-23 13:09 ` Subash Patel
2011-06-23 16:24 ` Michael K. Edwards
2011-06-23 22:09 ` Michael K. Edwards
2011-06-25 5:23 ` Jonathan Morton
2011-06-25 5:23 ` Jonathan Morton
2011-06-25 9:55 ` Michael K. Edwards
2011-06-26 0:06 ` Jonathan Morton
2011-06-24 15:20 ` Arnd Bergmann
2011-06-24 15:20 ` Arnd Bergmann
2011-06-24 9:18 ` Joerg Roedel
2011-06-24 14:26 ` Marek Szyprowski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='000701cc34c5$0c50b800$24f22800$%szyprowski@samsung.com' \
--to=m.szyprowski@samsung.com \
--cc=arnd@arndb.de \
--cc=joro@8bytes.org \
--cc=kyungmin.park@samsung.com \
--cc=linaro-mm-sig@lists.linaro.org \
--cc=linux-arch@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-mm@kvack.org \
--cc=linux@arm.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).