From: Arnd Bergmann <arnd@arndb.de>
To: Marek Szyprowski <m.szyprowski@samsung.com>
Cc: linux-arm-kernel@lists.infradead.org,
linux-samsung-soc@vger.kernel.org, linux-media@vger.kernel.org,
"Tomasz Stanislawski" <t.stanislaws@samsung.com>,
k.debski@samsung.com, kgene.kim@samsung.com,
kyungmin.park@samsung.com,
"Sylwester Nawrocki" <s.nawrocki@samsung.com>,
"Andrzej Pietrasiewicz" <andrzej.p@samsung.com>,
" '대인기'" <inki.dae@samsung.com>, " '강민규'" <mk7.kang@samsung.com>,
"'KyongHo Cho'" <pullip.cho@samsung.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/7] ARM: Samsung: update/rewrite Samsung SYSMMU (IOMMU) driver
Date: Fri, 11 Mar 2011 16:15:01 +0100 [thread overview]
Message-ID: <201103111615.01829.arnd@arndb.de> (raw)
In-Reply-To: <000101cbdffb$e1844b00$a48ce100$%szyprowski@samsung.com>
On Friday 11 March 2011, Marek Szyprowski wrote:
> On Friday, March 11, 2011 3:08 PM Arnd Bergmann wrote:
>
> > On Friday 11 March 2011, Marek Szyprowski wrote:
> > > > The iommu API is not really meant to be KVM specific, it's just that the
> > > > in-tree users are basically limited to KVM at the moment. Another user that
> > > > is coming up soon is the vmio device driver that can be used to transparently
> > > > pass devices to user space. The idea behind the IOMMU API is that you can
> > > > map arbitrary bus addresses to physical memory addresses, but it does not
> > > > deal with allocating the bus addresses or providing buffer management such
> > > > as cache flushes.
> > >
> > > Yea, I've noticed this and this basically what we expect from iommu driver.
> > > However the iommu.h API requires a separate call to map each single memory page.
> > > This is quite ineffective approach and imho the API need to be extended to allow
> > > mapping of the arbitrary set of pages.
> >
> > We can always discuss extensions to the existing infrastructure, adding
> > an interface for mapping an array of page pointers in the iommu API
> > sounds like a good idea.
>
> We will investigate this API further. From the first sight it looks it won't take
> much work to port/rewrite our driver to fit into iommu.h API.
Ok, sounds good.
> > I also think that we should not really have separate iommu and dma-mapping
> > interfaces, but rather have a portable way to define an iommu so that it
> > can be used through the dma-mapping interfaces. I'm not asking you to
> > do that as a prerequisite to merging your driver, but it may be good to
> > keep in mind that the current situation is still lacking and that any
> > suggestion for improving this as part of your work to support the
> > samsung IOMMU is welcome.
>
> Well creating a portable iommu framework and merging it with dma-mapping interface
> looks like a much harder (and time consuming) task. There is definitely a need for
> it. I hope that it can be developed incrementally starting from the current iommu.h
> and dma-mapping.h interfaces.
Yes, that is the idea. Maybe we should add it to the list things that the
Linaro kernel working group can target for the November release?
> Please note that there might be some subtle differences
> in the hardware that such framework must be aware. The first obvious one is the
> hardware design. Some platform has central iommu unit, other (like Samsung Exynos4)
> has a separate iommu unit per each device driver (this is still a simplification,
> because a video codec device has 2 memory interfaces and 2 iommu units). Currently
> I probably have not enough knowledge to predict the other possible issues that need
> to be taken into account in the portable and generic iommu/dma-mapping frame-work.
The dma-mapping API can deal well with one IOMMU per device, but would
need some tricks to work with one device that has two separate IOMMUs.
I'm not very familar with the iommu API, but in the common KVM scenario,
you need one IOMMU per device, so it should handle that just fine as well.
> > Note that the ARM implementation of the dma-mapping.h interface currently
> > does not support IOMMUs, but that could be changed by wrapping it
> > using the include/asm-generic/dma-mapping-common.h infrastructure.
>
> ARM dma-mapping framework also requires some additional research for better DMA
> support (there are still issues with multiple mappings to be resolved).
You mean mapping the same memory into multiple devices, or a different problem?
Arnd
next prev parent reply other threads:[~2011-03-11 15:15 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-04 9:01 [PATCH/RFC 0/7] Samsung IOMMU videobuf2 allocator and s5p-fimc update Marek Szyprowski
2011-03-04 9:01 ` [PATCH 1/7] ARM: S5PV310: Add platform definitions for FIMC Marek Szyprowski
2011-03-12 0:27 ` Kukjin Kim
2011-03-04 9:01 ` [PATCH 2/7] ARM: S5PV310: power domains: fixes and code cleanup Marek Szyprowski
2011-03-04 9:01 ` [PATCH 3/7] ARM: Samsung: update/rewrite Samsung SYSMMU (IOMMU) driver Marek Szyprowski
2011-03-04 16:04 ` Marek Szyprowski
2011-03-10 14:52 ` Arnd Bergmann
2011-03-11 9:04 ` Marek Szyprowski
2011-03-11 11:50 ` Arnd Bergmann
2011-03-11 12:35 ` Marek Szyprowski
2011-03-11 14:07 ` Arnd Bergmann
2011-03-11 14:51 ` Marek Szyprowski
2011-03-11 15:15 ` Arnd Bergmann [this message]
2011-03-11 15:39 ` Marek Szyprowski
2011-03-11 16:00 ` Arnd Bergmann
2011-03-14 12:37 ` KyongHo Cho
2011-03-14 12:46 ` Russell King - ARM Linux
2011-03-15 1:45 ` InKi Dae
2011-03-15 8:35 ` Russell King - ARM Linux
2011-03-15 9:34 ` daeinki
2011-03-15 9:53 ` Russell King - ARM Linux
2011-03-14 13:32 ` Arnd Bergmann
2011-03-04 9:01 ` [PATCH 4/7] v4l: videobuf2: add Samsung SYSMMU (IOMMU) based allocator Marek Szyprowski
2011-03-04 9:01 ` [PATCH 5/7] s5p-fimc: add pm_runtime support Marek Szyprowski
2011-03-04 9:01 ` [PATCH 6/7] s5p-fimc: Add support for vb2-s5p-iommu allocator Marek Szyprowski
2011-03-04 9:01 ` [PATCH 7/7] ARM: S5PC210: enable FIMC on Universal_C210 Marek Szyprowski
2011-03-08 7:28 ` [PATCH/RFC 0/7] Samsung IOMMU videobuf2 allocator and s5p-fimc update Kukjin Kim
2011-03-08 9:34 ` Marek Szyprowski
2011-03-08 10:05 ` InKi Dae
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=201103111615.01829.arnd@arndb.de \
--to=arnd@arndb.de \
--cc=andrzej.p@samsung.com \
--cc=inki.dae@samsung.com \
--cc=k.debski@samsung.com \
--cc=kgene.kim@samsung.com \
--cc=kyungmin.park@samsung.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=m.szyprowski@samsung.com \
--cc=mk7.kang@samsung.com \
--cc=pullip.cho@samsung.com \
--cc=s.nawrocki@samsung.com \
--cc=t.stanislaws@samsung.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