Skip to content

Commit e31c8ea

Browse files
digetxthierryreding
authored andcommitted
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>
1 parent 50bac83 commit e31c8ea

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

‎drivers/gpu/host1x/dev.c‎

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@
2929
#include <trace/events/host1x.h>
3030
#undef CREATE_TRACE_POINTS
3131

32+
#if IS_ENABLED(CONFIG_ARM_DMA_USE_IOMMU)
33+
#include <asm/dma-iommu.h>
34+
#endif
35+
3236
#include "bus.h"
3337
#include "channel.h"
3438
#include "debug.h"
@@ -217,7 +221,14 @@ static int host1x_probe(struct platform_device *pdev)
217221
dev_err(&pdev->dev, "failed to get reset: %d\n", err);
218222
return err;
219223
}
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
221232
if (IS_ENABLED(CONFIG_TEGRA_HOST1X_FIREWALL))
222233
goto skip_iommu;
223234

0 commit comments

Comments
 (0)