diff options
author | Dmitry Osipenko <digetx@gmail.com> | 2018-08-29 20:12:47 -0400 |
---|---|---|
committer | Thierry Reding <treding@nvidia.com> | 2018-09-26 11:11:14 -0400 |
commit | e31c8ea5aff8670275e4e451fdc3bca5fbc8a528 (patch) | |
tree | e14f0dad913d0e79f13bf68c69ae253ddc818ed4 /drivers/gpu | |
parent | 50bac83c80dd20e6c6b80afccadf5c70cbbc816e (diff) |
gpu: host1x: Detach Host1x from IOMMU DMA domain on arm32
Host1x is getting attached to an implicit IOMMU DMA domain if
CONFIG_ARM_DMA_USE_IOMMU=y. Since Host1x driver manages IOMMU by
itself, Host1x device must be detached from the implicit domain using
arch-specific IOMMU-API.
Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/host1x/dev.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/drivers/gpu/host1x/dev.c b/drivers/gpu/host1x/dev.c index d88073e7d22d..de6bc4e7fa23 100644 --- a/drivers/gpu/host1x/dev.c +++ b/drivers/gpu/host1x/dev.c | |||
@@ -29,6 +29,10 @@ | |||
29 | #include <trace/events/host1x.h> | 29 | #include <trace/events/host1x.h> |
30 | #undef CREATE_TRACE_POINTS | 30 | #undef CREATE_TRACE_POINTS |
31 | 31 | ||
32 | #if IS_ENABLED(CONFIG_ARM_DMA_USE_IOMMU) | ||
33 | #include <asm/dma-iommu.h> | ||
34 | #endif | ||
35 | |||
32 | #include "bus.h" | 36 | #include "bus.h" |
33 | #include "channel.h" | 37 | #include "channel.h" |
34 | #include "debug.h" | 38 | #include "debug.h" |
@@ -217,7 +221,14 @@ static int host1x_probe(struct platform_device *pdev) | |||
217 | dev_err(&pdev->dev, "failed to get reset: %d\n", err); | 221 | dev_err(&pdev->dev, "failed to get reset: %d\n", err); |
218 | return err; | 222 | return err; |
219 | } | 223 | } |
220 | 224 | #if IS_ENABLED(CONFIG_ARM_DMA_USE_IOMMU) | |
225 | if (host->dev->archdata.mapping) { | ||
226 | struct dma_iommu_mapping *mapping = | ||
227 | to_dma_iommu_mapping(host->dev); | ||
228 | arm_iommu_detach_device(host->dev); | ||
229 | arm_iommu_release_mapping(mapping); | ||
230 | } | ||
231 | #endif | ||
221 | if (IS_ENABLED(CONFIG_TEGRA_HOST1X_FIREWALL)) | 232 | if (IS_ENABLED(CONFIG_TEGRA_HOST1X_FIREWALL)) |
222 | goto skip_iommu; | 233 | goto skip_iommu; |
223 | 234 | ||