drm/tegra: Restrict IOVA space to DMA mask
authorThierry Reding <treding@nvidia.com>
Fri, 1 Feb 2019 13:28:34 +0000 (14:28 +0100)
committerThierry Reding <treding@nvidia.com>
Thu, 7 Feb 2019 17:29:00 +0000 (18:29 +0100)
commit02be8e4fbb1f352f2ed6251db9fddd646d531b6e
tree019e89c703461a0a4a6abae84b08a81c497d2d45
parentb9f8b09ce256e2e197b9a38984dea64e3404728c
drm/tegra: Restrict IOVA space to DMA mask

On Tegra186 and later, the ARM SMMU provides an input address space that
is 48 bits wide. However, memory clients can only address up to 40 bits.
If the geometry is used as-is, allocations of IOVA space can end up in a
region that cannot be addressed by the memory clients.

To fix this, restrict the IOVA space to the DMA mask of the host1x
device. Note that, technically, the IOVA space needs to be restricted to
the intersection of the DMA masks for all clients that are attached to
the IOMMU domain. In practice using the DMA mask of the host1x device is
sufficient because all host1x clients share the same DMA mask.

Signed-off-by: Thierry Reding <treding@nvidia.com>
drivers/gpu/drm/tegra/drm.c