From: Yong Wu <yong.wu@mediatek.com>
To: Robin Murphy <robin.murphy@arm.com>
Cc: "ritesh.harjani@gmail.com" <ritesh.harjani@gmail.com>,
"lauraa@codeaurora.org" <lauraa@codeaurora.org>,
"arnd@arndb.de" <arnd@arndb.de>,
"stefano.stabellini@eu.citrix.com"
<stefano.stabellini@eu.citrix.com>,
Catalin Marinas <Catalin.Marinas@arm.com>,
"joro@8bytes.org" <joro@8bytes.org>,
"thunder.leizhen@huawei.com" <thunder.leizhen@huawei.com>,
Will Deacon <Will.Deacon@arm.com>,
"linux@arm.linux.org.uk" <linux@arm.linux.org.uk>,
"iommu@lists.linux-foundation.org"
<iommu@lists.linux-foundation.org>,
"suravee.suthikulpanit@amd.com" <suravee.suthikulpanit@amd.com>,
"josephl@nvidia.com" <josephl@nvidia.com>,
Yingjoe Chen <yingjoe.chen@mediatek.com>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>
Subject: Re: [RFC PATCH v2 2/3] arm64: add IOMMU dma_ops
Date: Tue, 3 Mar 2015 11:38:47 +0800 [thread overview]
Message-ID: <1425353927.4555.10.camel@mhfsdcap03> (raw)
In-Reply-To: <54E24D50.408@arm.com>
On Mon, 2015-02-16 at 20:04 +0000, Robin Murphy wrote:
> > 2)int (*domain_init)(struct iommu_domain *domain);
> > About this function, it will alloc pagetable for the iommu
> > domain. And We expect the pagetable memory is uncacheable, so try to
> > call "dma_alloc_coherent", unfortunately the "struct device *" can't be
> > passed into this function. so is it possible if adding a parameter in
> > this function.
>
> ...one of the ideas of the new of_iommu_configure framework is that
> iommu_ops structures can represent individual IOMMU devices if
> necessary. The ops->priv pointer was included for that purpose, but
> isn't very clean so Will has plans to remove it again - it's easy enough
> to achieve the same effect by having the driver embed the ops in its
> private instance data instead. I've done that with the ARM SMMU driver
> which has a similar issue of needing hardware details at domain_init()
> time (no patches ready yet but I have an iommu/dev branch on top of the
> iommu/dma branch with some current work-in-progress bits)
>
> Thanks,
> Robin.
>
Dear Robin,
Thanks very much for your suggestion.
I have a more question: how to do cache maintenance in arm64.
a) "__dma_flush_range" can not be expected to used directly.
b) Following Documentation\DMA-API.txt, section: Streaming DMA
mappings. dma_map_single should be used, But I am not sure how to pass
the first "struct device *".
We have a device which call arch_setup_dma_ops to create the
iommu domain, if we use this device, it will enter __iommu_map_page;
If we input NULL for dmap_map_single, it will assert at
dma_capable in swiotlb_map_page...
And normally, we always need do cache maintenance only for some
bytes in the pagetable but not whole a page. Then is there a easy way to
do the cache maintenance?
next prev parent reply other threads:[~2015-03-03 3:38 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-06 14:55 [RFC PATCH v2 0/3] arm64: IOMMU-backed DMA mapping Robin Murphy
[not found] ` <cover.1423226542.git.robin.murphy-5wv7dgnIgG8@public.gmane.org>
2015-02-06 14:55 ` [RFC PATCH v2 1/3] iommu: implement common IOMMU ops for " Robin Murphy
[not found] ` <da0e905ae94f2fca241a47b2a20e078255e45a81.1423226542.git.robin.murphy-5wv7dgnIgG8@public.gmane.org>
2015-02-09 4:05 ` Will Deacon
[not found] ` <20150209040539.GE13969-5wv7dgnIgG8@public.gmane.org>
2015-02-10 15:11 ` Robin Murphy
2015-03-12 12:45 ` Marek Szyprowski
2015-02-06 14:55 ` [RFC PATCH v2 2/3] arm64: add IOMMU dma_ops Robin Murphy
[not found] ` <058e038009ac708a40197c80e07410914c2a162e.1423226542.git.robin.murphy-5wv7dgnIgG8@public.gmane.org>
2015-02-09 6:02 ` Will Deacon
[not found] ` <20150209060224.GG13969-5wv7dgnIgG8@public.gmane.org>
2015-02-10 15:40 ` Robin Murphy
2015-02-10 4:39 ` Yingjoe Chen
2015-02-10 12:07 ` Robin Murphy
[not found] ` <54D9F486.10501-5wv7dgnIgG8@public.gmane.org>
2015-02-14 8:03 ` Yong Wu
2015-02-16 20:04 ` Robin Murphy
2015-03-03 3:38 ` Yong Wu [this message]
2015-03-03 12:15 ` Robin Murphy
[not found] ` <54F5A5FE.3040506-5wv7dgnIgG8@public.gmane.org>
2015-03-05 0:19 ` Laura Abbott
[not found] ` <54F7A121.3050103-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2015-03-05 11:16 ` Robin Murphy
2015-03-09 17:59 ` Russell King - ARM Linux
[not found] ` <20150309175904.GC8656-l+eeeJia6m9vn6HldHNs0ANdhmdF6hFW@public.gmane.org>
2015-03-09 20:09 ` Robin Murphy
[not found] ` <54FDFE0D.8030807-5wv7dgnIgG8@public.gmane.org>
2015-03-10 10:16 ` Robin Murphy
2015-03-12 12:50 ` Marek Szyprowski
2015-02-06 14:55 ` [RFC PATCH v2 3/3] arm64: hook up " Robin Murphy
[not found] ` <482b3b109a3d4818b1b1e693f488a919cf1bb707.1423226542.git.robin.murphy-5wv7dgnIgG8@public.gmane.org>
2015-03-03 11:05 ` leizhen
[not found] ` <54F59565.7000807-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2015-03-03 13:10 ` Robin Murphy
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=1425353927.4555.10.camel@mhfsdcap03 \
--to=yong.wu@mediatek.com \
--cc=Catalin.Marinas@arm.com \
--cc=Will.Deacon@arm.com \
--cc=arnd@arndb.de \
--cc=iommu@lists.linux-foundation.org \
--cc=joro@8bytes.org \
--cc=josephl@nvidia.com \
--cc=lauraa@codeaurora.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux@arm.linux.org.uk \
--cc=ritesh.harjani@gmail.com \
--cc=robin.murphy@arm.com \
--cc=stefano.stabellini@eu.citrix.com \
--cc=suravee.suthikulpanit@amd.com \
--cc=thunder.leizhen@huawei.com \
--cc=yingjoe.chen@mediatek.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