From: thierry.reding@gmail.com (Thierry Reding)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 3/4] ARM: dma-mapping: Implement arch_iommu_detach_device()
Date: Wed, 25 Apr 2018 11:29:38 +0200 [thread overview]
Message-ID: <20180425092938.GA21182@ulmo> (raw)
In-Reply-To: <20180425091815.16264-3-thierry.reding@gmail.com>
On Wed, Apr 25, 2018 at 11:18:14AM +0200, Thierry Reding wrote:
[...]
> diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c
> index 8c398fedbbb6..1957938d8c9c 100644
> --- a/arch/arm/mm/dma-mapping.c
> +++ b/arch/arm/mm/dma-mapping.c
> @@ -2366,6 +2366,21 @@ static void arm_teardown_iommu_dma_ops(struct device *dev)
> arm_iommu_release_mapping(mapping);
> }
>
> +void arch_iommu_detach_device(struct device *dev)
> +{
> + struct dma_iommu_mapping *mapping = to_dma_iommu_mapping(dev);
> + const struct dma_map_ops *dma_ops;
> +
> + if (!mapping)
> + return;
> +
> + arm_iommu_release_mapping(mapping);
> + arm_iommu_detach_device(dev);
> +
> + dma_ops = arm_get_dma_map_ops(dev->archdata.dma_coherent);
> + set_dma_ops(dev, dma_ops);
> +}
Oh, the irony! This doesn't actually build and I failed to notice
because I forgot to enable ARM_DMA_USE_IOMMU...
Sorry about that, but I think we can use this as basis to discuss
whether the API is good and I'll make sure to properly test the next
revision before sending it out.
Thierry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20180425/ee6a8fdb/attachment.sig>
next prev parent reply other threads:[~2018-04-25 9:29 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-25 9:18 [PATCH 1/4] drm/nouveau: tegra: Detach from ARM DMA/IOMMU mapping Thierry Reding
2018-04-25 9:18 ` [PATCH 2/4] dma-mapping: Introduce dma_iommu_detach_device() API Thierry Reding
2018-04-25 9:18 ` [PATCH 3/4] ARM: dma-mapping: Implement arch_iommu_detach_device() Thierry Reding
2018-04-25 9:29 ` Thierry Reding [this message]
2018-04-26 21:00 ` kbuild test robot
2018-04-25 9:18 ` [PATCH 4/4] drm/nouveau: tegra: Use dma_iommu_detach_device() Thierry Reding
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=20180425092938.GA21182@ulmo \
--to=thierry.reding@gmail.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).