gpu: host1x: Use correct semantics for HOST1X_CHANNEL_DMAEND
authorThierry Reding <treding@nvidia.com>
Fri, 1 Feb 2019 13:28:29 +0000 (14:28 +0100)
committerThierry Reding <treding@nvidia.com>
Thu, 7 Feb 2019 17:28:58 +0000 (18:28 +0100)
commit0e43b8da154a95f4369da4068a43ad9d700f4cea
tree25b86a7d2e0c567f2e4d77360fce720cc99519f9
parent8de896eb206fea3caa26b5fc8e637934d8486f0f
gpu: host1x: Use correct semantics for HOST1X_CHANNEL_DMAEND

The HOST1X_CHANNEL_DMAEND is an offset relative to the value written to
the HOST1X_CHANNEL_DMASTART register, but it is currently treated as an
absolute address. This can cause SMMU faults if the CDMA fetches past a
pushbuffer's IOMMU mapping.

Properly setting the DMAEND prevents the CDMA from fetching beyond that
address and avoid such issues. This is currently not observed because a
whole (almost) page of essentially scratch space absorbs any excessive
prefetching by CDMA. However, changing the number of slots in the push
buffer can trigger these SMMU faults.

Signed-off-by: Thierry Reding <treding@nvidia.com>
drivers/gpu/host1x/hw/cdma_hw.c