From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Robin Murphy <robin.murphy@arm.com>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>,
Geert Uytterhoeven <geert+renesas@glider.be>,
Joerg Roedel <joro@8bytes.org>,
Catalin Marinas <catalin.marinas@arm.com>,
Will Deacon <will.deacon@arm.com>,
Marek Szyprowski <m.szyprowski@samsung.com>,
Magnus Damm <magnus.damm@gmail.com>,
iommu@lists.linux-foundation.org,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
Linux-Renesas <linux-renesas-soc@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] iommu/dma: Add support for DMA_ATTR_FORCE_CONTIGUOUS
Date: Sun, 15 Jan 2017 23:12:49 +0200 [thread overview]
Message-ID: <1782501.BR5drHV8iS@avalon> (raw)
In-Reply-To: <0e5c066f-ddf6-30ce-392e-79bd0f401a18@arm.com>
Hi Robin,
On Friday 13 Jan 2017 12:17:24 Robin Murphy wrote:
> On 13/01/17 11:59, Geert Uytterhoeven wrote:
> > On Fri, Jan 13, 2017 at 12:32 PM, Robin Murphy wrote:
> >> On 13/01/17 11:07, Geert Uytterhoeven wrote:
> >>> Add support for DMA_ATTR_FORCE_CONTIGUOUS to the generic IOMMU DMA code.
> >>> This allows to allocate physically contiguous DMA buffers on arm64
> >>> systems with an IOMMU.
> >>
> >> Can anyone explain what this attribute is actually used for? I've never
> >> quite figured it out.
> >
> > My understanding is that DMA_ATTR_FORCE_CONTIGUOUS is needed when using
> > an IOMMU but wanting the buffers to be both contiguous in IOVA space and
> > physically contiguous to allow passing to devices without IOMMU.
> >
> > Main users are graphic and remote processors.
>
> Sure, I assumed it must be to do with buffer sharing, but the systems
> I'm aware of which have IOMMUs in their media subsystems tend to have
> them in front of every IP block involved, so I was curious as to what
> bit of non-IOMMU hardware wanted to play too. The lone in-tree use in
> the Exynos DRM driver was never very revealing, and the new one I see in
> the Qualcomm PIL driver frankly looks redundant to me.
If two (or more) devices with different memory requirements are involved in
buffer sharing, we need to either allocate and export buffers from the device
with the strictest requirements, or to implement a central buffer allocator.
In any case, I don't think DMA_ATTR_FORCE_CONTIGUOUS is the right solution to
that problem.
Forcing contiguous allocation can however help with performance optimization,
as mapping physically contiguous memory through IOMMUs can make use of larger
page sizes.
--
Regards,
Laurent Pinchart
prev parent reply other threads:[~2017-01-15 21:12 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-13 11:07 [PATCH] iommu/dma: Add support for DMA_ATTR_FORCE_CONTIGUOUS Geert Uytterhoeven
2017-01-13 11:32 ` Robin Murphy
2017-01-13 11:59 ` Geert Uytterhoeven
2017-01-13 12:17 ` Robin Murphy
2017-01-13 12:36 ` Geert Uytterhoeven
2017-01-15 21:12 ` Laurent Pinchart [this message]
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=1782501.BR5drHV8iS@avalon \
--to=laurent.pinchart@ideasonboard.com \
--cc=catalin.marinas@arm.com \
--cc=geert+renesas@glider.be \
--cc=geert@linux-m68k.org \
--cc=iommu@lists.linux-foundation.org \
--cc=joro@8bytes.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=m.szyprowski@samsung.com \
--cc=magnus.damm@gmail.com \
--cc=robin.murphy@arm.com \
--cc=will.deacon@arm.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