All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/2] drm/nouveau: tegra: Detach from ARM DMA/IOMMU mapping
@ 2018-05-30  8:03 ` Thierry Reding
  0 siblings, 0 replies; 26+ messages in thread
From: Thierry Reding @ 2018-05-30  8:03 UTC (permalink / raw)
  To: Ben Skeggs, Christoph Hellwig, Russell King
  Cc: nouveau, Joerg Roedel, iommu, dri-devel, Jordan Crouse,
	Daniel Vetter, linux-tegra, Robin Murphy, linux-arm-kernel

From: Thierry Reding <treding@nvidia.com>

An unfortunate interaction between the 32-bit ARM DMA/IOMMU mapping code
and Tegra SMMU driver changes to support IOMMU groups introduced a boot-
time regression on Tegra124. This was caught very late because none of
the standard configurations that are tested on Tegra enable the ARM DMA/
IOMMU mapping code since it is not needed.

The reason for the failure is that the GPU found on Tegra uses a special
bit in physical addresses to determine whether or not a buffer is mapped
through the SMMU. In order to achieve this, the Nouveau driver needs to
explicitly understand which buffers are mapped through the SMMU and
which aren't. Hiding usage of the SMMU behind the DMA API is bound to
fail because the knowledge doesn't exist. Furthermore, the GPU has its
own IOMMU and in most cases doesn't need buffers to be physically or
virtually contiguous. One notable exception is for compressible buffers
which need to be mapped with large pages, which in turn require all the
small pages in a large page to be contiguous. This can be achieved with
an SMMU mapping, though it isn't currently supported in Nouveau. Since
Translating through the SMMU is unnecessary and can have a negative
impact on performance for the common case, so we want to avoid it when
possible.

This series of patches adds a 32-bit ARM specific 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   |  5 +++++
 4 files changed, 28 insertions(+)

-- 
2.17.0

^ permalink raw reply	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2018-05-30 14:07 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-30  8:03 [PATCH v3 0/2] drm/nouveau: tegra: Detach from ARM DMA/IOMMU mapping Thierry Reding
2018-05-30  8:03 ` Thierry Reding
2018-05-30  8:03 ` [PATCH v3 1/2] ARM: dma-mapping: Implement arm_dma_iommu_detach_device() Thierry Reding
2018-05-30  8:03   ` Thierry Reding
     [not found]   ` <20180530080345.2353-2-thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2018-05-30  9:59     ` Robin Murphy
2018-05-30  9:59       ` Robin Murphy
     [not found]       ` <eee02391-aa25-da84-f98a-b5fed6c69599-5wv7dgnIgG8@public.gmane.org>
2018-05-30 12:54         ` Thierry Reding
2018-05-30 12:54           ` Thierry Reding
2018-05-30 13:12           ` Thierry Reding
2018-05-30 13:12             ` Thierry Reding
2018-05-30 13:42             ` Robin Murphy
2018-05-30 13:42               ` Robin Murphy
     [not found]               ` <d3121aeb-1d75-2ba6-681a-f1e0681e290a-5wv7dgnIgG8@public.gmane.org>
2018-05-30 14:07                 ` Thierry Reding
2018-05-30 14:07                   ` Thierry Reding
2018-05-30  8:03 ` [PATCH v3 2/2] drm/nouveau: tegra: Detach from ARM DMA/IOMMU mapping Thierry Reding
2018-05-30  8:03   ` Thierry Reding
     [not found]   ` <20180530080345.2353-3-thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2018-05-30 10:30     ` Robin Murphy
2018-05-30 10:30       ` Robin Murphy
     [not found]       ` <7960e4fc-f680-f8d1-0c5a-3ff1e13b3154-5wv7dgnIgG8@public.gmane.org>
2018-05-30 13:00         ` Thierry Reding
2018-05-30 13:00           ` Thierry Reding
2018-05-30 13:30           ` Robin Murphy
2018-05-30 13:30             ` Robin Murphy
2018-05-30 13:41             ` Thierry Reding
2018-05-30 13:41               ` Thierry Reding
2018-05-30 13:46               ` Robin Murphy
2018-05-30 13:46                 ` Robin Murphy

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.