* [GIT PULL] DMA-mapping framework updates for 3.4
@ 2012-03-20 7:24 Marek Szyprowski
2012-03-21 13:43 ` Marek Szyprowski
2012-03-23 21:35 ` Linus Torvalds
0 siblings, 2 replies; 4+ messages in thread
From: Marek Szyprowski @ 2012-03-20 7:24 UTC (permalink / raw)
To: linux-arm-kernel
Hi Linus,
Please pull the dma-mapping framework updates for v3.4 since commit
c16fa4f2ad19908a47c63d8fa436a1178438c7e7:
Linux 3.3
with the top-most commit e749a9f707f1102735e02338fa564be86be3bb69
common: DMA-mapping: add NON-CONSISTENT attribute
from the git repository at:
git://git.infradead.org/users/kmpark/linux-samsung dma-mapping-next
Those patches introduce a new alloc method (with support for memory
attributes) in dma_map_ops structure, which will later replace
dma_alloc_coherent and dma_alloc_writecombine functions.
Thanks!
Best regards
Marek Szyprowski
Samsung Poland R&D Center
Patch summary:
Andrzej Pietrasiewicz (9):
X86: adapt for dma_map_ops changes
MIPS: adapt for dma_map_ops changes
PowerPC: adapt for dma_map_ops changes
IA64: adapt for dma_map_ops changes
SPARC: adapt for dma_map_ops changes
Alpha: adapt for dma_map_ops changes
SH: adapt for dma_map_ops changes
Microblaze: adapt for dma_map_ops changes
Unicore32: adapt for dma_map_ops changes
Marek Szyprowski (6):
common: dma-mapping: introduce alloc_attrs and free_attrs methods
Hexagon: adapt for dma_map_ops changes
common: dma-mapping: remove old alloc_coherent and free_coherent methods
common: dma-mapping: introduce mmap method
common: DMA-mapping: add WRITE_COMBINE attribute
common: DMA-mapping: add NON-CONSISTENT attribute
Documentation/DMA-attributes.txt | 19 +++++++++++++++++++
arch/alpha/include/asm/dma-mapping.h | 18 ++++++++++++------
arch/alpha/kernel/pci-noop.c | 10 ++++++----
arch/alpha/kernel/pci_iommu.c | 10 ++++++----
arch/hexagon/include/asm/dma-mapping.h | 18 ++++++++++++------
arch/hexagon/kernel/dma.c | 9 +++++----
arch/ia64/hp/common/sba_iommu.c | 11 ++++++-----
arch/ia64/include/asm/dma-mapping.h | 18 ++++++++++++------
arch/ia64/kernel/pci-swiotlb.c | 9 +++++----
arch/ia64/sn/pci/pci_dma.c | 9 +++++----
arch/microblaze/include/asm/dma-mapping.h | 18 ++++++++++++------
arch/microblaze/kernel/dma.c | 10 ++++++----
arch/mips/cavium-octeon/dma-octeon.c | 16 ++++++++--------
arch/mips/include/asm/dma-mapping.h | 18 ++++++++++++------
arch/mips/mm/dma-default.c | 8 ++++----
arch/powerpc/include/asm/dma-mapping.h | 24 ++++++++++++++++--------
arch/powerpc/kernel/dma-iommu.c | 10 ++++++----
arch/powerpc/kernel/dma-swiotlb.c | 4 ++--
arch/powerpc/kernel/dma.c | 10 ++++++----
arch/powerpc/kernel/ibmebus.c | 10 ++++++----
arch/powerpc/kernel/vio.c | 14 ++++++++------
arch/powerpc/platforms/cell/iommu.c | 16 +++++++++-------
arch/powerpc/platforms/ps3/system-bus.c | 13 +++++++------
arch/sh/include/asm/dma-mapping.h | 28 ++++++++++++++++++----------
arch/sh/kernel/dma-nommu.c | 4 ++--
arch/sh/mm/consistent.c | 6 ++++--
arch/sparc/include/asm/dma-mapping.h | 18 ++++++++++++------
arch/sparc/kernel/iommu.c | 10 ++++++----
arch/sparc/kernel/ioport.c | 18 ++++++++++--------
arch/sparc/kernel/pci_sun4v.c | 9 +++++----
arch/unicore32/include/asm/dma-mapping.h | 18 ++++++++++++------
arch/unicore32/mm/dma-swiotlb.c | 4 ++--
arch/x86/include/asm/dma-mapping.h | 26 ++++++++++++++++----------
arch/x86/kernel/amd_gart_64.c | 11 ++++++-----
arch/x86/kernel/pci-calgary_64.c | 9 +++++----
arch/x86/kernel/pci-dma.c | 3 ++-
arch/x86/kernel/pci-nommu.c | 6 +++---
arch/x86/kernel/pci-swiotlb.c | 12 +++++++-----
arch/x86/xen/pci-swiotlb-xen.c | 4 ++--
drivers/iommu/amd_iommu.c | 10 ++++++----
drivers/iommu/intel-iommu.c | 9 +++++----
drivers/xen/swiotlb-xen.c | 5 +++--
include/linux/dma-attrs.h | 2 ++
include/linux/dma-mapping.h | 13 +++++++++----
include/linux/swiotlb.h | 6 ++++--
include/xen/swiotlb-xen.h | 6 ++++--
lib/swiotlb.c | 5 +++--
47 files changed, 338 insertions(+), 206 deletions(-)
^ permalink raw reply [flat|nested] 4+ messages in thread
* [GIT PULL] DMA-mapping framework updates for 3.4
2012-03-20 7:24 [GIT PULL] DMA-mapping framework updates for 3.4 Marek Szyprowski
@ 2012-03-21 13:43 ` Marek Szyprowski
2012-03-23 21:35 ` Linus Torvalds
1 sibling, 0 replies; 4+ messages in thread
From: Marek Szyprowski @ 2012-03-21 13:43 UTC (permalink / raw)
To: linux-arm-kernel
Hello,
On Tuesday, March 20, 2012 8:25 AM Marek Szyprowski wrote:
> Hi Linus,
>
> Please pull the dma-mapping framework updates for v3.4 since commit
> c16fa4f2ad19908a47c63d8fa436a1178438c7e7:
>
> Linux 3.3
>
> with the top-most commit e749a9f707f1102735e02338fa564be86be3bb69
>
> common: DMA-mapping: add NON-CONSISTENT attribute
>
> from the git repository at:
>
> git://git.infradead.org/users/kmpark/linux-samsung dma-mapping-next
>
> Those patches introduce a new alloc method (with support for memory
> attributes) in dma_map_ops structure, which will later replace
> dma_alloc_coherent and dma_alloc_writecombine functions.
I've been pointed out that this summary is quite short and misses the main
rationale for the proposed changes.
A few limitations have been identified in the current dma-mapping design and
its implementations for various architectures. There exist more than one function
for allocating and freeing the buffers: currently these 3 are used dma_{alloc,
free}_coherent, dma_{alloc,free}_writecombine, dma_{alloc,free}_noncoherent.
For most of the systems these calls are almost equivalent and can be interchanged.
For others, especially the truly non-coherent ones (like ARM), the difference can
be easily noticed in overall driver performance. Sadly not all architectures
provide implementations for all of them, so the drivers might need to be adapted
and cannot be easily shared between different architectures. The provided patches
unify all these functions and hide the differences under the already existing
dma attributes concept. The thread with more references is available here:
http://www.spinics.net/lists/linux-sh/msg09777.html
These patches are also a prerequisite for unifying DMA-mapping implementation
on ARM architecture with the common one provided by dma_map_ops structure and
extending it with IOMMU support. More information is available in the following
thread: http://thread.gmane.org/gmane.linux.kernel.cross-arch/12819
More works on dma-mapping framework are planned, especially in the area of buffer
sharing and managing the shared mappings (together with the recently introduced
dma_buf interface: commit d15bd7ee445d0702ad801fdaece348fdb79e6581 "dma-buf:
Introduce dma buffer sharing mechanism" ).
Best regards
--
Marek Szyprowski
Samsung Poland R&D Center
^ permalink raw reply [flat|nested] 4+ messages in thread
* [GIT PULL] DMA-mapping framework updates for 3.4
2012-03-20 7:24 [GIT PULL] DMA-mapping framework updates for 3.4 Marek Szyprowski
2012-03-21 13:43 ` Marek Szyprowski
@ 2012-03-23 21:35 ` Linus Torvalds
2012-03-27 9:59 ` Marek Szyprowski
1 sibling, 1 reply; 4+ messages in thread
From: Linus Torvalds @ 2012-03-23 21:35 UTC (permalink / raw)
To: linux-arm-kernel
On Tue, Mar 20, 2012 at 12:24 AM, Marek Szyprowski
<m.szyprowski@samsung.com> wrote:
>
> ?git://git.infradead.org/users/kmpark/linux-samsung dma-mapping-next
>
> Those patches introduce a new alloc method (with support for memory
> attributes) in dma_map_ops structure, which will later replace
> dma_alloc_coherent and dma_alloc_writecombine functions.
So I'm quite unhappy with these patches.
Here's just the few problems I saw from some *very* quick look-through
of the git tree:
- I'm not seeing ack's from the architecture maintainers for the
patches that change some architecture.
- Even more importantly, what I really want is acks and comments from
the people who are expected to *use* this.
- it looks like patches break compilation half-way through the
series. Just one example I noticed: the "x86 adaptation" patch changes
the functions in lib/swiotlb.c, but afaik ia64 *also* uses those. So
now ia64 is broken until a couple of patches later. I suspect there
are other examples like that.
- the sign-off chains are odd. What happened there? Several patches
are signed off by Kyungmin Park, but he doesn't seem to be "in the
chain" at all. Whazzup? (*)
(Btw, I notice the same thing in the tree I pulled from Dave Airlie,
btw - what the F is going on with samsung submissions - those are
marked as committed by Dave Airlie, and don't have Dave in the
sign-off chain at all!)
- Finally, how/why are "dma attributes" different from the per-device
dma limits ("device_dma_parameters")
Hmm?
Linus
(*) Btw, I notice the same thing in the tree I pulled from Dave
Airlie, btw - what the F is going on with samsung submissions - those
are marked as committed by Dave Airlie, and don't have Dave in the
sign-off chain at all! Dave?
^ permalink raw reply [flat|nested] 4+ messages in thread
* [GIT PULL] DMA-mapping framework updates for 3.4
2012-03-23 21:35 ` Linus Torvalds
@ 2012-03-27 9:59 ` Marek Szyprowski
0 siblings, 0 replies; 4+ messages in thread
From: Marek Szyprowski @ 2012-03-27 9:59 UTC (permalink / raw)
To: linux-arm-kernel
Hi Linus,
On Friday, March 23, 2012 10:36 PM Linus Torvalds wrote:
> On Tue, Mar 20, 2012 at 12:24 AM, Marek Szyprowski
> <m.szyprowski@samsung.com> wrote:
> >
> > ?git://git.infradead.org/users/kmpark/linux-samsung dma-mapping-next
> >
> > Those patches introduce a new alloc method (with support for memory
> > attributes) in dma_map_ops structure, which will later replace
> > dma_alloc_coherent and dma_alloc_writecombine functions.
>
> So I'm quite unhappy with these patches.
>
> Here's just the few problems I saw from some *very* quick look-through
> of the git tree:
>
> - I'm not seeing ack's from the architecture maintainers for the
> patches that change some architecture.
Ok, I've asked personally each respective maintainer for an ack or
comments. Before I've sent my pull request there were only a few comments
on the mailing lists, but this topic have been discussed at ELC-E in Prague
and Linaro Memory-management summit in Budapest (May 2011).
> - Even more importantly, what I really want is acks and comments from
> the people who are expected to *use* this.
The plan is to use it as a base for further cleanup in the dma-mapping
implementations, especially on ARM architecture. The changes are designed
in such a way to keep compatibility with the existing users of the API.
ARM will be the first architecture which will use the new attributes.
The main clients for this new API will be mainly multimedia drivers (v4l2,
drm) and dma_buf buffer sharing. The advantage of this approach is the
fact that the same drivers can be used on other architectures without any
changes in the dma calls. The attributes which are not supported by the
architecture will be simply ignored.
> - it looks like patches break compilation half-way through the
> series. Just one example I noticed: the "x86 adaptation" patch changes
> the functions in lib/swiotlb.c, but afaik ia64 *also* uses those. So
> now ia64 is broken until a couple of patches later. I suspect there
> are other examples like that.
Ok, I missed this and I will fix this issue asap.
> - the sign-off chains are odd. What happened there? Several patches
> are signed off by Kyungmin Park, but he doesn't seem to be "in the
> chain" at all. Whazzup? (*)
That was caused by our internal flow of the patches, but I see that it
made only a lot of confusion. I got my own git repository at
git.linaro.org and I will resolve these sign-off issues correctly there.
> - Finally, how/why are "dma attributes" different from the per-device
> dma limits ("device_dma_parameters")
Device dma parameters are global for all dma mapping operations for the
specified device, while dma attributes can be set for each allocation or
mapping call. Dma attributes are mainly used to provide some hints to the
dma mapping core, which might improve speed/performance/throughput for
some particular sw&hw architectures. Unsupported attributes are ignored,
so the in the worst case a driver gets coherent mapping.
Best regards
--
Marek Szyprowski
Samsung Poland R&D Center
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-03-27 9:59 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-20 7:24 [GIT PULL] DMA-mapping framework updates for 3.4 Marek Szyprowski
2012-03-21 13:43 ` Marek Szyprowski
2012-03-23 21:35 ` Linus Torvalds
2012-03-27 9:59 ` Marek Szyprowski
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).