linux-sh.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Niklas Söderlund" <niklas.soderlund@ragnatech.se>
To: linux-sh@vger.kernel.org
Subject: [RFC 0/4] dmaengine: rcar-dmac: add iommu support for slave transfers
Date: Fri, 08 Jan 2016 08:23:02 +0000	[thread overview]
Message-ID: <1452241386-22830-1-git-send-email-niklas.soderlund+renesas@ragnatech.se> (raw)

Hi,

In this series I (try) to enable IOMMU support for rcar-dma. This
prototype works fine and is test on a lager board but it might have some
odd design choices.

What I'm most concerned about is that I could not find a good way too
keep track of mappings from different DMA channels to the same address
so that they could properly be unmapped. This issue is due to that two
channels might both try to map the same address (think rx/tx pair) and
that would make it unsafe for any one of the channels to unmap the
address without knowing if it's in use by the other.

A follow up problem to this is that if the same address is mapped from
two different channels but with different sizes and the larger size is
tried last. If such a condition should happen and the larger size is so
large that it crosses a page boundary there would be trouble.

An obvious solution to both problem would be to map address to different
iova:s in each channel and keep track of the unique mapping. That way
all the above problems would go away. The problem is I can't figure out
how to allocate a unique iova to feed to iommu_map.

Patch 4/4 is only included to show what I turn on to verify the series.
To do the verification on the lager board I simply run md5sum on
/dev/mmcblk1.


Niklas Söderlund (4):
  iommu: add function iommu_min_pgsize
  dmaengine: rcar-dmac: add iommu support for slave transfers
  ARM: dts: r8a7790: add iommus to dmac0 and dmac1
  enable ipmmu for devcies connected to ipmmu_ds

 arch/arm/boot/dts/r8a7790.dtsi      | 32 +++++++++++++++++++++++-
 arch/arm/configs/shmobile_defconfig |  3 ++-
 drivers/dma/sh/rcar-dmac.c          | 50 ++++++++++++++++++++++++++++++++++++-
 include/linux/iommu.h               | 10 ++++++++
 4 files changed, 92 insertions(+), 3 deletions(-)

--
2.6.4


             reply	other threads:[~2016-01-08  8:23 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-08  8:23 Niklas Söderlund [this message]
2016-01-08  9:28 ` [RFC 0/4] dmaengine: rcar-dmac: add iommu support for slave transfers Geert Uytterhoeven
2016-01-11  2:31 ` Niklas Söderlund

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=1452241386-22830-1-git-send-email-niklas.soderlund+renesas@ragnatech.se \
    --to=niklas.soderlund@ragnatech.se \
    --cc=linux-sh@vger.kernel.org \
    /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).