[lkml]   [2019]   [Nov]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Subject[PATCH v3 0/4] dma-mapping: introduce new dma unmap and sync variants
From: Laurentiu Tudor <>

This series introduces a few new dma unmap and sync api variants that,
on top of what the originals do, return the virtual address
corresponding to the input dma address. In order to do that a new dma
map op is added, .get_virt_addr that takes the input dma address and
returns the virtual address backing it up.
The second patch adds an implementation for this new dma map op in the
generic iommu dma glue code and wires it in.
The third patch updates the dpaa2-eth driver to use the new apis.


Changes in v3
* drop useless check for null iommu domain (Robin)
* add dma_can_unmap_by_dma_addr() to check availability of
these new apis (Christoph)
* make apis work with direct dma (Christoph)
* add support for swiotlb (Robin)
* simplify dpaa2_eth driver code by using dma_unmap_single_desc()
instead of dma_unmap_page_desc()

Changes in v2
* use "dma_unmap_*_desc" names (Robin)
* return va/page instead of phys addr (Robin)

Changes since RFC
* completely changed the approach: added unmap and sync variants that
return the phys addr instead of adding a new dma to phys conversion

Laurentiu Tudor (4):
dma-mapping: introduce new dma unmap and sync api variants
iommu/dma: wire-up new dma map op .get_virt_addr
swiotlb: make new {unmap,sync}_desc dma apis work with swiotlb
dpaa2_eth: use new unmap and sync dma api variants

drivers/iommu/dma-iommu.c | 13 ++++
.../net/ethernet/freescale/dpaa2/dpaa2-eth.c | 43 +++++-----
.../net/ethernet/freescale/dpaa2/dpaa2-eth.h | 1 -
include/linux/dma-mapping.h | 45 +++++++++++
include/linux/swiotlb.h | 7 ++
kernel/dma/mapping.c | 78 +++++++++++++++++++
kernel/dma/swiotlb.c | 8 ++
7 files changed, 169 insertions(+), 26 deletions(-)


 \ /
  Last update: 2019-11-13 13:25    [W:0.131 / U:0.296 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site