From: arnd@arndb.de (Arnd Bergmann)
To: linux-arm-kernel@lists.infradead.org
Subject: [Linaro-mm-sig][RFC] ARM: dma-mapping: Add DMA attribute to skip iommu mapping
Date: Tue, 15 Jan 2013 19:05:11 +0000 [thread overview]
Message-ID: <201301151905.11704.arnd@arndb.de> (raw)
In-Reply-To: <50F570A4.70606@samsung.com>
On Tuesday 15 January 2013, Marek Szyprowski wrote:
> I'm sorry, but from my perspective this patch and the yet another dma
> attribute shows that there is something fishy happening in the exynos-drm
> driver. Creating a mapping in DMA address space is the MAIN purpose of
> the DMA mapping subsystem, so adding an attribute which skips this
> operation already should give you a sign of warning that something is
> not used right.
>
> It looks that dma-mapping in the current state is simply not adequate
> for this driver. I noticed that DRM drivers are already known for
> implementing a lots of common code for their own with slightly changed
> behavior, like custom page manager/allocator. It looks that exynos-drm
> driver grew to the point where it also needs such features. It already
> contains custom code for CPU cache handling, IOMMU and contiguous
> memory special cases management. I would advise to drop DMA-mapping
> API completely, avoid adding yet another dozen of DMA attributes useful
> only for one driver and implement your own memory manager with direct
> usage of IOMMU API, alloc_pages() and dma_alloc_pages_from_contiguous().
> This way DMA mapping subsystem can be kept simple, robust and easy to
> understand without confusing or conflicting parts.
Makes sense. DRM drivers and KVM are the two cases where you typically
want to use the iommu API rather than the dma-mapping API, because you
need protection between multiple concurrent user contexts.
Arnd
WARNING: multiple messages have this Message-ID (diff)
From: Arnd Bergmann <arnd@arndb.de>
To: Marek Szyprowski <m.szyprowski@samsung.com>
Cc: Abhinav Kochhar <abhinav.k@samsung.com>,
linux-arm-kernel@lists.infradead.org,
linaro-mm-sig@lists.linaro.org, linux-mm@kvack.org,
inki.dae@samsung.com
Subject: Re: [Linaro-mm-sig][RFC] ARM: dma-mapping: Add DMA attribute to skip iommu mapping
Date: Tue, 15 Jan 2013 19:05:11 +0000 [thread overview]
Message-ID: <201301151905.11704.arnd@arndb.de> (raw)
In-Reply-To: <50F570A4.70606@samsung.com>
On Tuesday 15 January 2013, Marek Szyprowski wrote:
> I'm sorry, but from my perspective this patch and the yet another dma
> attribute shows that there is something fishy happening in the exynos-drm
> driver. Creating a mapping in DMA address space is the MAIN purpose of
> the DMA mapping subsystem, so adding an attribute which skips this
> operation already should give you a sign of warning that something is
> not used right.
>
> It looks that dma-mapping in the current state is simply not adequate
> for this driver. I noticed that DRM drivers are already known for
> implementing a lots of common code for their own with slightly changed
> behavior, like custom page manager/allocator. It looks that exynos-drm
> driver grew to the point where it also needs such features. It already
> contains custom code for CPU cache handling, IOMMU and contiguous
> memory special cases management. I would advise to drop DMA-mapping
> API completely, avoid adding yet another dozen of DMA attributes useful
> only for one driver and implement your own memory manager with direct
> usage of IOMMU API, alloc_pages() and dma_alloc_pages_from_contiguous().
> This way DMA mapping subsystem can be kept simple, robust and easy to
> understand without confusing or conflicting parts.
Makes sense. DRM drivers and KVM are the two cases where you typically
want to use the iommu API rather than the dma-mapping API, because you
need protection between multiple concurrent user contexts.
Arnd
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2013-01-15 19:05 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-08 10:12 [Linaro-mm-sig][RFC] ARM: dma-mapping: Add DMA attribute to skip iommu mapping Abhinav Kochhar
2013-01-08 10:12 ` Abhinav Kochhar
2013-01-15 15:07 ` Marek Szyprowski
2013-01-15 15:07 ` Marek Szyprowski
2013-01-15 19:05 ` Arnd Bergmann [this message]
2013-01-15 19:05 ` 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=201301151905.11704.arnd@arndb.de \
--to=arnd@arndb.de \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.