From: Rob Clark <robdclark@gmail.com>
To: Robin Murphy <robin.murphy@arm.com>
Cc: Christoph Hellwig <hch@lst.de>,
"list@263.net:IOMMU DRIVERS <iommu@lists.linux-foundation.org>,
Joerg Roedel <joro@8bytes.org>," <joro@8bytes.org>,
Russell King - ARM Linux <linux@armlinux.org.uk>,
Geert Uytterhoeven <geert+renesas@glider.be>,
dri-devel <dri-devel@lists.freedesktop.org>,
Bjorn Andersson <bjorn.andersson@linaro.org>,
Matthias Brugger <matthias.bgg@gmail.com>,
Thierry Reding <thierry.reding@gmail.com>,
Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
digetx@gmail.com, Suman Anna <s-anna@ti.com>,
Will Deacon <will@kernel.org>,
Marek Szyprowski <m.szyprowski@samsung.com>,
"moderated list:ARM/S5P EXYNOS AR..."
<linux-samsung-soc@vger.kernel.org>,
Magnus Damm <magnus.damm@gmail.com>,
Kyungmin Park <kyungmin.park@samsung.com>,
Jonathan Hunter <jonathanh@nvidia.com>,
Andy Gross <agross@kernel.org>, Yong Wu <yong.wu@mediatek.com>,
linux-media@vger.kernel.org,
linux-arm-msm <linux-arm-msm@vger.kernel.org>,
Krishna Reddy <vdumpa@nvidia.com>,
"moderated list:ARM/Mediatek SoC..."
<linux-mediatek@lists.infradead.org>,
linux-tegra@vger.kernel.org,
"moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE"
<linux-arm-kernel@lists.infradead.org>,
Seung-Woo Kim <sw0312.kim@samsung.com>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
t-kristo@ti.com,
"list@263.net:IOMMU DRIVERS <iommu@lists.linux-foundation.org>,
Joerg Roedel <joro@8bytes.org>,"
<iommu@lists.linux-foundation.org>
Subject: Re: [PATCH 10/18] iommu/msm: Add IOMMU_DOMAIN_DMA support
Date: Thu, 20 Aug 2020 08:55:02 -0700 [thread overview]
Message-ID: <CAF6AEGuKa4P=gfus08CdfT2H5pG6a2PBumGb=Pw3qvD=NWueig@mail.gmail.com> (raw)
In-Reply-To: <93d7de3533cfd952aecd6198b9221d7a58c0e521.1597931876.git.robin.murphy@arm.com>
Side note, I suspect we'll end up needing something like
0e764a01015dfebff8a8ffd297d74663772e248a .. if someone can dig a 32b
device out of the closet and dust it off, the fix is easy enough.
Just wanted to mention that here so anyone with a 32b device could
find what is needed.
BR,
-R
On Thu, Aug 20, 2020 at 8:09 AM Robin Murphy <robin.murphy@arm.com> wrote:
>
> Now that arch/arm is wired up for default domains and iommu-dma,
> implement the corresponding driver-side support for DMA domains.
>
> Signed-off-by: Robin Murphy <robin.murphy@arm.com>
> ---
> drivers/iommu/msm_iommu.c | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/iommu/msm_iommu.c b/drivers/iommu/msm_iommu.c
> index 3615cd6241c4..f34efcbb0b2b 100644
> --- a/drivers/iommu/msm_iommu.c
> +++ b/drivers/iommu/msm_iommu.c
> @@ -8,6 +8,7 @@
> #include <linux/kernel.h>
> #include <linux/init.h>
> #include <linux/platform_device.h>
> +#include <linux/dma-iommu.h>
> #include <linux/errno.h>
> #include <linux/io.h>
> #include <linux/io-pgtable.h>
> @@ -314,13 +315,16 @@ static struct iommu_domain *msm_iommu_domain_alloc(unsigned type)
> {
> struct msm_priv *priv;
>
> - if (type != IOMMU_DOMAIN_UNMANAGED)
> + if (type != IOMMU_DOMAIN_UNMANAGED && type != IOMMU_DOMAIN_DMA)
> return NULL;
>
> priv = kzalloc(sizeof(*priv), GFP_KERNEL);
> if (!priv)
> goto fail_nomem;
>
> + if (type == IOMMU_DOMAIN_DMA && iommu_get_dma_cookie(&priv->domain))
> + goto fail_nomem;
> +
> INIT_LIST_HEAD(&priv->list_attached);
>
> priv->domain.geometry.aperture_start = 0;
> @@ -339,6 +343,7 @@ static void msm_iommu_domain_free(struct iommu_domain *domain)
> struct msm_priv *priv;
> unsigned long flags;
>
> + iommu_put_dma_cookie(domain);
> spin_lock_irqsave(&msm_iommu_lock, flags);
> priv = to_msm_priv(domain);
> kfree(priv);
> --
> 2.28.0.dirty
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2020-08-20 15:55 UTC|newest]
Thread overview: 50+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20200820150857eucas1p18f5f2ad87703a68b6ed20a090f7c1c57@eucas1p1.samsung.com>
2020-08-20 15:08 ` [PATCH 00/18] Convert arch/arm to use iommu-dma Robin Murphy
2020-08-20 15:08 ` [PATCH 01/18] ARM/dma-mapping: Drop .dma_supported for IOMMU ops Robin Murphy
2020-08-20 15:08 ` [PATCH 02/18] ARM/dma-mapping: Consolidate IOMMU ops callbacks Robin Murphy
2020-08-20 15:08 ` [PATCH 03/18] ARM/dma-mapping: Merge IOMMU ops Robin Murphy
2020-08-20 15:08 ` [PATCH 04/18] iommu/dma: Add temporary hacks for arch/arm Robin Murphy
2020-08-20 15:08 ` [PATCH 05/18] ARM/dma-mapping: Switch to iommu_dma_ops Robin Murphy
2020-09-28 11:32 ` Marek Szyprowski
2020-08-20 15:08 ` [PATCH 06/18] ARM/dma-mapping: Support IOMMU default domains Robin Murphy
2020-08-20 15:08 ` [PATCH 07/18] iommu/arm-smmu: Remove arch/arm workaround Robin Murphy
2020-08-21 8:07 ` Will Deacon
2020-08-20 15:08 ` [PATCH 08/18] iommu/renesas: " Robin Murphy
2020-08-20 15:08 ` [PATCH 09/18] iommu/mediatek-v1: Add IOMMU_DOMAIN_DMA support Robin Murphy
2020-08-29 9:54 ` Yong Wu
2020-08-20 15:08 ` [PATCH 10/18] iommu/msm: " Robin Murphy
2020-08-20 15:55 ` Rob Clark [this message]
2020-08-20 16:58 ` Robin Murphy
2020-08-20 17:05 ` Rob Clark
2020-08-20 15:08 ` [PATCH 11/18] iommu/omap: " Robin Murphy
2020-08-24 21:39 ` Suman Anna
2020-08-20 15:08 ` [PATCH 12/18] iommu/tegra-gart: " Robin Murphy
2020-08-20 20:16 ` Dmitry Osipenko
2020-08-21 0:28 ` Robin Murphy
2020-08-23 21:42 ` Dmitry Osipenko
2020-08-20 15:08 ` [PATCH 13/18] iommu/tegra: " Robin Murphy
2020-08-27 15:45 ` Thierry Reding
2020-08-27 18:18 ` Robin Murphy
2020-08-20 15:08 ` [PATCH 14/18] drm/exynos: Consolidate IOMMU mapping code Robin Murphy
2020-09-18 14:30 ` Marek Szyprowski
2020-09-21 2:09 ` Inki Dae
2020-08-20 15:08 ` [PATCH 15/18] drm/nouveau/tegra: Clean up IOMMU workaround Robin Murphy
2020-08-20 15:08 ` [PATCH 16/18] staging/media/tegra-vde: " Robin Murphy
2020-08-20 19:51 ` Dmitry Osipenko
2020-08-20 20:10 ` Dmitry Osipenko
2020-08-21 0:11 ` Robin Murphy
2020-08-23 21:34 ` Dmitry Osipenko
2020-08-24 14:01 ` Robin Murphy
2020-08-27 7:05 ` Dmitry Osipenko
2020-08-27 15:54 ` Thierry Reding
2020-08-30 19:44 ` Dmitry Osipenko
2020-08-20 15:08 ` [PATCH 17/18] media/omap3isp: " Robin Murphy
2020-08-20 16:53 ` Sakari Ailus
2020-08-20 17:25 ` Robin Murphy
2020-08-20 19:55 ` Sakari Ailus
2020-08-20 23:01 ` Robin Murphy
2020-08-24 21:55 ` Suman Anna
2020-08-20 15:08 ` [PATCH 18/18] ARM/dma-mapping: Remove legacy dma-iommu API Robin Murphy
2020-08-24 11:40 ` [PATCH 00/18] Convert arch/arm to use iommu-dma Marek Szyprowski
2020-09-18 15:13 ` Marek Szyprowski
2020-08-27 12:31 ` Aw: " Frank Wunderlich
2020-08-27 12:54 ` Matthias Brugger
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='CAF6AEGuKa4P=gfus08CdfT2H5pG6a2PBumGb=Pw3qvD=NWueig@mail.gmail.com' \
--to=robdclark@gmail.com \
--cc=agross@kernel.org \
--cc=bjorn.andersson@linaro.org \
--cc=digetx@gmail.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=geert+renesas@glider.be \
--cc=hch@lst.de \
--cc=iommu@lists.linux-foundation.org \
--cc=jonathanh@nvidia.com \
--cc=joro@8bytes.org \
--cc=kyungmin.park@samsung.com \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=m.szyprowski@samsung.com \
--cc=magnus.damm@gmail.com \
--cc=matthias.bgg@gmail.com \
--cc=robin.murphy@arm.com \
--cc=s-anna@ti.com \
--cc=sw0312.kim@samsung.com \
--cc=t-kristo@ti.com \
--cc=thierry.reding@gmail.com \
--cc=vdumpa@nvidia.com \
--cc=will@kernel.org \
--cc=yong.wu@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;
as well as URLs for NNTP newsgroup(s).