From: Marek Szyprowski <m.szyprowski-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
To: Catalin Marinas <catalin.marinas-5wv7dgnIgG8@public.gmane.org>
Cc: "arnd-r2nGTMty4D4@public.gmane.org"
<arnd-r2nGTMty4D4@public.gmane.org>,
Will Deacon <Will.Deacon-5wv7dgnIgG8@public.gmane.org>,
"linaro-mm-sig-cunTk1MwBs8s++Sfvej+rw@public.gmane.org"
<linaro-mm-sig-cunTk1MwBs8s++Sfvej+rw@public.gmane.org>,
"iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org"
<iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org>,
"linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
<linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
"linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org"
<linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org>
Subject: Re: DMA mapping API(IOMMU) for ARM64?
Date: Wed, 19 Jun 2013 11:29:18 +0200 [thread overview]
Message-ID: <51C179EE.5030609@samsung.com> (raw)
In-Reply-To: <20130618125054.GL9930-5wv7dgnIgG8@public.gmane.org>
Hello,
On 6/18/2013 2:50 PM, Catalin Marinas wrote:
> On Tue, Jun 18, 2013 at 12:01:37PM +0100, Hiroshi Doyu wrote:
> > Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org> wrote @ Tue, 18 Jun 2013 12:32:44 +0200:
> > > On Tuesday 18 June 2013 11:19:14 Will Deacon wrote:
> > > > I've spoken briefly with Catalin about this and it seems like there might be
> > > > *some* scope for sharing common dma-mapping code between architectures.
> > > > There doesn't really need to be any architecture-specific details in
> > > > allocating iova space and the interface to the iommu drivers is
> > > > well-defined. The arch-specific stuff is bogged down in the non-coherent
> > > > buffer management, but that doesn't necessarily equate to lots of code.
> > > >
> > > > So, the best bet would be to figure out how to split up what we have under
> > > > arch/arm/ so that it can be re-used by arm64 and potentially other
> > > > architectures (powerpc has some simple stuff for coherent mappings and some
> > > > less-simple stuff for non-coherent buffers).
> > >
> > > I'm sure that other architectures are interested in sharing the code.
> > > Best move it into the global mm/ directory, at least the version for
> > > coherent mappings.
> >
> > I'm guessing that this kind of unification usually takes some time
> > since we need to factor out the common code from the different
> > ${ARCH}/mm/dma-mapping.c. Also some of ${ARCH} has IOMMU support in
> > it. So if we want to develop our 64-bit ARM with working DMA mapping
> > API during this transition, the step to take would be:
> >
> > 1, Copy arch/arm/mm/dma-mapping.c arch/arm64/mm/dma-mapping.c(+swiotlb)
> > 2, Adapt arch/arm64/mm/dma-mapping.c(+swiotlb) to 64bit compatible.
> > 3, Factor out the common code from them into mm/dma-mapping.c
>
> Or add the relevant code to something like lib/iommu-helper.c, convert
> arm64 to use that and we can work on converting arm and other
> architectures afterwards.
I think that this would be the best way of providing iommu support for
dma mapping
subsystem(s). I initially put it in arm/mm/dma-mapping.c because it was
the first
approach of integrating generic IOMMU with DMA-mapping and it was simply
easier to
have all the code in one place. Now, when second client of such approach
comes, it
should be much easier to identify which part of the code is common and
which one is
specific to particular implementation. Feel free to ask any questions if
you need
help. I don't have access to any ARM64 machine or simulator, so I can
only review
the code.
Best regards
--
Marek Szyprowski
Samsung R&D Institute Poland
next prev parent reply other threads:[~2013-06-19 9:29 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20130618.053955.305832937374936961.hdoyu@nvidia.com>
[not found] ` <20130618101914.GB3539@mudshark.cambridge.arm.com>
[not found] ` <5159282.rrJMaZuYMv@wuerfel>
2013-06-18 11:01 ` DMA mapping API(IOMMU) for ARM64? Hiroshi Doyu
2013-06-18 12:50 ` Catalin Marinas
2013-06-18 22:08 ` Don Dutile
[not found] ` <51C0DA4F.1010405-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2013-06-19 11:11 ` Catalin Marinas
[not found] ` <20130618125054.GL9930-5wv7dgnIgG8@public.gmane.org>
2013-06-18 14:15 ` Arnd Bergmann
[not found] ` <201306181615.27341.arnd-r2nGTMty4D4@public.gmane.org>
2013-06-18 15:20 ` Hiroshi Doyu
2013-06-19 9:29 ` Marek Szyprowski [this message]
[not found] ` <20130618.140137.1551430695673122122.hdoyu-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2013-06-18 12:51 ` Arnd Bergmann
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=51C179EE.5030609@samsung.com \
--to=m.szyprowski-sze3o3uu22jbdgjk7y7tuq@public.gmane.org \
--cc=Will.Deacon-5wv7dgnIgG8@public.gmane.org \
--cc=arnd-r2nGTMty4D4@public.gmane.org \
--cc=catalin.marinas-5wv7dgnIgG8@public.gmane.org \
--cc=iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
--cc=linaro-mm-sig-cunTk1MwBs8s++Sfvej+rw@public.gmane.org \
--cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.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