search for: arm_dma_iommu_detach_device

Displaying 17 results from an estimated 17 matches for "arm_dma_iommu_detach_device".

2018 May 30
2
[PATCH v3 1/2] ARM: dma-mapping: Implement arm_dma_iommu_detach_device()
...-mapping.h > +++ b/arch/arm/include/asm/dma-mapping.h > @@ -103,6 +103,9 @@ extern void arch_setup_dma_ops(struct device *dev, u64 dma_base, u64 size, > #define arch_teardown_dma_ops arch_teardown_dma_ops > extern void arch_teardown_dma_ops(struct device *dev); > > +#define arm_dma_iommu_detach_device arm_dma_iommu_detach_device > +extern void arm_dma_iommu_detach_device(struct device *dev); > + > /* do not use this function in a driver */ > static inline bool is_device_dma_coherent(struct device *dev) > { > diff --git a/arch/arm/mm/dma-mapping-nommu.c b/arch/arm/mm/dma-m...
2018 May 30
0
[PATCH v3 1/2] ARM: dma-mapping: Implement arm_dma_iommu_detach_device()
...44 --- a/arch/arm/include/asm/dma-mapping.h +++ b/arch/arm/include/asm/dma-mapping.h @@ -103,6 +103,9 @@ extern void arch_setup_dma_ops(struct device *dev, u64 dma_base, u64 size, #define arch_teardown_dma_ops arch_teardown_dma_ops extern void arch_teardown_dma_ops(struct device *dev); +#define arm_dma_iommu_detach_device arm_dma_iommu_detach_device +extern void arm_dma_iommu_detach_device(struct device *dev); + /* do not use this function in a driver */ static inline bool is_device_dma_coherent(struct device *dev) { diff --git a/arch/arm/mm/dma-mapping-nommu.c b/arch/arm/mm/dma-mapping-nommu.c index f448a0663b10...
2018 May 30
2
[PATCH v3 1/2] ARM: dma-mapping: Implement arm_dma_iommu_detach_device()
...nclude/asm/dma-mapping.h > > > @@ -103,6 +103,9 @@ extern void arch_setup_dma_ops(struct device *dev, u64 dma_base, u64 size, > > > #define arch_teardown_dma_ops arch_teardown_dma_ops > > > extern void arch_teardown_dma_ops(struct device *dev); > > > +#define arm_dma_iommu_detach_device arm_dma_iommu_detach_device > > > +extern void arm_dma_iommu_detach_device(struct device *dev); > > > + > > > /* do not use this function in a driver */ > > > static inline bool is_device_dma_coherent(struct device *dev) > > > { > > > diff...
2018 May 30
0
[PATCH v3 1/2] ARM: dma-mapping: Implement arm_dma_iommu_detach_device()
...gt; +++ b/arch/arm/include/asm/dma-mapping.h > > @@ -103,6 +103,9 @@ extern void arch_setup_dma_ops(struct device *dev, u64 dma_base, u64 size, > > #define arch_teardown_dma_ops arch_teardown_dma_ops > > extern void arch_teardown_dma_ops(struct device *dev); > > +#define arm_dma_iommu_detach_device arm_dma_iommu_detach_device > > +extern void arm_dma_iommu_detach_device(struct device *dev); > > + > > /* do not use this function in a driver */ > > static inline bool is_device_dma_coherent(struct device *dev) > > { > > diff --git a/arch/arm/mm/dma-mappi...
2018 May 30
0
[PATCH v3 1/2] ARM: dma-mapping: Implement arm_dma_iommu_detach_device()
.../dma-mapping.h >>>> @@ -103,6 +103,9 @@ extern void arch_setup_dma_ops(struct device *dev, u64 dma_base, u64 size, >>>> #define arch_teardown_dma_ops arch_teardown_dma_ops >>>> extern void arch_teardown_dma_ops(struct device *dev); >>>> +#define arm_dma_iommu_detach_device arm_dma_iommu_detach_device >>>> +extern void arm_dma_iommu_detach_device(struct device *dev); >>>> + >>>> /* do not use this function in a driver */ >>>> static inline bool is_device_dma_coherent(struct device *dev) >>>> { >&g...
2018 May 30
4
[PATCH v3 0/2] drm/nouveau: tegra: Detach from ARM DMA/IOMMU mapping
...cific API that allows a driver to detach the device from the DMA/IOMMU mapping so that it can provide its own implementation for dealing with the SMMU. The second patch makes use of that new API in the Nouveau driver to fix the regression. Thierry Thierry Reding (2): ARM: dma-mapping: Implement arm_dma_iommu_detach_device() drm/nouveau: tegra: Detach from ARM DMA/IOMMU mapping arch/arm/include/asm/dma-mapping.h | 3 +++ arch/arm/mm/dma-mapping-nommu.c | 4 ++++ arch/arm/mm/dma-mapping.c | 16 ++++++++++++++++ .../gpu/drm/nouveau/nvkm/engine/device/tegra.c...
2018 May 30
2
[PATCH v3 2/2] drm/nouveau: tegra: Detach from ARM DMA/IOMMU mapping
...5,6 +105,11 @@ nvkm_device_tegra_probe_iommu(struct nvkm_device_tegra *tdev) >>> unsigned long pgsize_bitmap; >>> int ret; >>> +#if IS_ENABLED(CONFIG_ARM) >> >> Wouldn't CONFIG_ARM_DMA_USE_IOMMU be even more appropriate? > > Not necessarily. arm_dma_iommu_detach_device() is always defined on ARM, > only with CONFIG_ARM_DMA_USE_IOMMU=n it will be empty. So this check is > a guard to make sure we don't call the function when it isn't available, > but it may still not do anything. Calling a function under condition A, which only does anything under...
2018 Apr 25
2
[PATCH v2 2/5] dma-mapping: Introduce dma_iommu_detach_device() API
...tach a device from an IOMMU that architecture code might have attached > to. This is useful for drivers that need explicit control over the IOMMU > using the IOMMU API directly. Given that no one else implements it making it a generic API seems rather confusing. For now I'd rename it to arm_dma_iommu_detach_device() and only implement it in arm. Once I've got the dma mapping implementations consolidated to a small enough number we could think about something like a device quirk that tells the architecture to simply never even attach the iommu dma ops to start with.
2018 May 30
2
[PATCH v3 2/2] drm/nouveau: tegra: Detach from ARM DMA/IOMMU mapping
...,6 +105,11 @@ nvkm_device_tegra_probe_iommu(struct nvkm_device_tegra *tdev) > unsigned long pgsize_bitmap; > int ret; > > +#if IS_ENABLED(CONFIG_ARM) Wouldn't CONFIG_ARM_DMA_USE_IOMMU be even more appropriate? > + /* make sure we can use the IOMMU exclusively */ > + arm_dma_iommu_detach_device(dev); As before, I would just use the existing infrastructure the same way the Exynos DRM driver currently does in __exynos_iommu_attach() (albeit without then reattaching to another DMA ops mapping). Robin. > +#endif > + > if (!tdev->func->iommu_bit) > return; >...
2018 Apr 30
2
[PATCH v2 2/5] dma-mapping: Introduce dma_iommu_detach_device() API
...e attached > > > to. This is useful for drivers that need explicit control over the IOMMU > > > using the IOMMU API directly. > > > > Given that no one else implements it making it a generic API seems > > rather confusing. For now I'd rename it to > > arm_dma_iommu_detach_device() and only implement it in arm. > > That'd be suboptimal because this code is used on both 32-bit and 64-bit > ARM. If we make the function 32-bit ARM specific then the driver code > would need to use an #ifdef to make sure compilation doesn't break on > 64-bit ARM. Do you...
2018 May 30
0
[PATCH v3 2/2] drm/nouveau: tegra: Detach from ARM DMA/IOMMU mapping
...ice/tegra.c > > @@ -105,6 +105,11 @@ nvkm_device_tegra_probe_iommu(struct nvkm_device_tegra *tdev) > > unsigned long pgsize_bitmap; > > int ret; > > +#if IS_ENABLED(CONFIG_ARM) > > Wouldn't CONFIG_ARM_DMA_USE_IOMMU be even more appropriate? Not necessarily. arm_dma_iommu_detach_device() is always defined on ARM, only with CONFIG_ARM_DMA_USE_IOMMU=n it will be empty. So this check is a guard to make sure we don't call the function when it isn't available, but it may still not do anything. > > > + /* make sure we can use the IOMMU exclusively */ > > + arm_...
2018 May 30
0
[PATCH v3 2/2] drm/nouveau: tegra: Detach from ARM DMA/IOMMU mapping
...(struct nvkm_device_tegra *tdev) > > > > unsigned long pgsize_bitmap; > > > > int ret; > > > > +#if IS_ENABLED(CONFIG_ARM) > > > > > > Wouldn't CONFIG_ARM_DMA_USE_IOMMU be even more appropriate? > > > > Not necessarily. arm_dma_iommu_detach_device() is always defined on ARM, > > only with CONFIG_ARM_DMA_USE_IOMMU=n it will be empty. So this check is > > a guard to make sure we don't call the function when it isn't available, > > but it may still not do anything. > > Calling a function under condition A, which...
2018 Apr 30
1
[PATCH v2 2/5] dma-mapping: Introduce dma_iommu_detach_device() API
...rivers that need explicit control over the IOMMU > > > > > using the IOMMU API directly. > > > > > > > > Given that no one else implements it making it a generic API seems > > > > rather confusing. For now I'd rename it to > > > > arm_dma_iommu_detach_device() and only implement it in arm. > > > > > > That'd be suboptimal because this code is used on both 32-bit and 64-bit > > > ARM. If we make the function 32-bit ARM specific then the driver code > > > would need to use an #ifdef to make sure compilation doesn&...
2018 Apr 26
0
[PATCH v2 2/5] dma-mapping: Introduce dma_iommu_detach_device() API
...at architecture code might have attached > > to. This is useful for drivers that need explicit control over the IOMMU > > using the IOMMU API directly. > > Given that no one else implements it making it a generic API seems > rather confusing. For now I'd rename it to > arm_dma_iommu_detach_device() and only implement it in arm. That'd be suboptimal because this code is used on both 32-bit and 64-bit ARM. If we make the function 32-bit ARM specific then the driver code would need to use an #ifdef to make sure compilation doesn't break on 64-bit ARM. Thierry -------------- next part...
2018 Apr 30
0
[PATCH v2 2/5] dma-mapping: Introduce dma_iommu_detach_device() API
...>>> to. This is useful for drivers that need explicit control over the IOMMU >>>> using the IOMMU API directly. >>> >>> Given that no one else implements it making it a generic API seems >>> rather confusing. For now I'd rename it to >>> arm_dma_iommu_detach_device() and only implement it in arm. >> >> That'd be suboptimal because this code is used on both 32-bit and 64-bit >> ARM. If we make the function 32-bit ARM specific then the driver code >> would need to use an #ifdef to make sure compilation doesn't break on >> 6...
2018 May 30
0
[PATCH v3 2/2] drm/nouveau: tegra: Detach from ARM DMA/IOMMU mapping
...nouveau/nvkm/engine/device/tegra.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c @@ -105,6 +105,11 @@ nvkm_device_tegra_probe_iommu(struct nvkm_device_tegra *tdev) unsigned long pgsize_bitmap; int ret; +#if IS_ENABLED(CONFIG_ARM) + /* make sure we can use the IOMMU exclusively */ + arm_dma_iommu_detach_device(dev); +#endif + if (!tdev->func->iommu_bit) return; -- 2.17.0
2018 Apr 25
11
[PATCH v2 1/5] drm/nouveau: tegra: Detach from ARM DMA/IOMMU mapping
From: Thierry Reding <treding at nvidia.com> Depending on the kernel configuration, early ARM architecture setup code may have attached the GPU to a DMA/IOMMU mapping that transparently uses the IOMMU to back the DMA API. Tegra requires special handling for IOMMU backed buffers (a special bit in the GPU's MMU page tables indicates the memory path to take: via the SMMU or directly to the