iommu.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
From: Laurentiu Tudor <laurentiu.tudor@nxp.com>
To: "hch@lst.de" <hch@lst.de>,
	"robin.murphy@arm.com" <robin.murphy@arm.com>,
	 "joro@8bytes.org" <joro@8bytes.org>,
	Ioana Ciocoi Radulescu <ruxandra.radulescu@nxp.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"iommu@lists.linux-foundation.org"
	<iommu@lists.linux-foundation.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	Ioana Ciornei <ioana.ciornei@nxp.com>
Cc: Madalin Bucur <madalin.bucur@nxp.com>,
	Leo Li <leoyang.li@nxp.com>,
	Camelia Alexandra Groza <camelia.groza@nxp.com>,
	"davem@davemloft.net" <davem@davemloft.net>
Subject: [PATCH v3 0/4] dma-mapping: introduce new dma unmap and sync variants
Date: Wed, 13 Nov 2019 12:24:17 +0000	[thread overview]
Message-ID: <20191113122407.1171-1-laurentiu.tudor@nxp.com> (raw)

From: Laurentiu Tudor <laurentiu.tudor@nxp.com>

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.

Context: https://lkml.org/lkml/2019/5/31/684

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
   function

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(-)

-- 
2.17.1

_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

             reply	other threads:[~2019-11-13 12:24 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-13 12:24 Laurentiu Tudor [this message]
2019-11-13 12:24 ` [PATCH v3 1/4] dma-mapping: introduce new dma unmap and sync api variants Laurentiu Tudor
2019-11-13 12:24 ` [PATCH v3 2/4] iommu/dma: wire-up new dma map op .get_virt_addr Laurentiu Tudor
2019-11-13 12:24 ` [PATCH v3 3/4] swiotlb: make new {unmap, sync}_desc dma apis work with swiotlb Laurentiu Tudor
2019-11-13 12:24 ` [PATCH v3 4/4] dpaa2_eth: use new unmap and sync dma api variants Laurentiu Tudor
2019-11-13 20:11 ` [PATCH v3 0/4] dma-mapping: introduce new dma unmap and sync variants David Miller
2019-11-14 11:13   ` Laurentiu Tudor
2019-11-21  7:41   ` Christoph Hellwig
2019-12-02 14:58     ` Madalin Bucur

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=20191113122407.1171-1-laurentiu.tudor@nxp.com \
    --to=laurentiu.tudor@nxp.com \
    --cc=camelia.groza@nxp.com \
    --cc=davem@davemloft.net \
    --cc=hch@lst.de \
    --cc=ioana.ciornei@nxp.com \
    --cc=iommu@lists.linux-foundation.org \
    --cc=joro@8bytes.org \
    --cc=leoyang.li@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=madalin.bucur@nxp.com \
    --cc=netdev@vger.kernel.org \
    --cc=robin.murphy@arm.com \
    --cc=ruxandra.radulescu@nxp.com \
    /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).