linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: m.szyprowski@samsung.com (Marek Szyprowski)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 3/7] ARM: Samsung: update/rewrite Samsung SYSMMU (IOMMU) driver
Date: Fri, 11 Mar 2011 13:35:21 +0100	[thread overview]
Message-ID: <000001cbdfe8$ce444b20$6acce160$%szyprowski@samsung.com> (raw)
In-Reply-To: <201103111250.51252.arnd@arndb.de>

Hello,

On Friday, March 11, 2011 12:51 PM Arnd Bergmann wrote:

> On Friday 11 March 2011, Marek Szyprowski wrote:
> >
> > We followed the style of iommu API for other mainline ARM platforms (both OMAP and MSM
> > also have custom API for their iommu modules). I've briefly checked include/linux/iommu.h
> > API and I've noticed that it has been designed mainly for KVM support. There is also
> > include/linux/intel-iommu.h interface, but I it is very specific to intel gfx chips.
> 
> The MSM code actually uses the generic iommu.h code, using register_iommu, so
> the drivers can use the regular iommu_map.
> 
> I believe the omap code predates the iommu API, and should really be changed
> to use that. At least it was added before I started reviewing the code.
> 
> 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.

> > Is there any example how include/linux/dma-mapping.h interface can be used for iommu
> > mappings?
> 
> The dma-mapping API is the normal interface that you should use for IOMMUs
> that sit between DMA devices and kernel memory. The idea is that you
> completely abstract the concept of an IOMMU so the device driver uses
> the same code for talking to a device with an IOMMU and another device with
> a linear mapping or an swiotlb bounce buffer.
> 
> This means that the user of the dma-mapping API does not get to choose the
> bus addresses, but instead you use the API to get a bus address for a
> chunk of memory, and then you can pass that address to a device.
> 
> See arch/powerpc/kernel/iommu.c and arch/x86/kernel/amd_iommu.c for common
> examples of how this is implemented. The latter one actually implements
> both the iommu_ops for iommu.h and dma_map_ops for dma-mapping.h.

Thanks for your comments! We will check how is it suitable for our case.

Best regards
--
Marek Szyprowski
Samsung Poland R&D Center

  reply	other threads:[~2011-03-11 12:35 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 [this message]
2011-03-11 14:07             ` Arnd Bergmann
2011-03-11 14:51               ` Marek Szyprowski
2011-03-11 15:15                 ` Arnd Bergmann
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='000001cbdfe8$ce444b20$6acce160$%szyprowski@samsung.com' \
    --to=m.szyprowski@samsung.com \
    --cc=linux-arm-kernel@lists.infradead.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).