drm/tegra: Add back arm_iommu_detach_device()
authorDmitry Osipenko <digetx@gmail.com>
Sat, 4 Dec 2021 14:58:49 +0000 (17:58 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 27 Jan 2022 10:02:59 +0000 (11:02 +0100)
commitb9a524d6ec03a9c74f6547fe87d78d84a7e00608
treeaf9e235750e7afdf0b93023d6d2fd04f439724c8
parent3ff8942bb8ab930250065df68b8f7ac575d8b041
drm/tegra: Add back arm_iommu_detach_device()

commit d210919dbdc8a82c676cc3e3c370b1802be63124 upstream.

DMA buffers of 2D/3D engines aren't mapped properly when
CONFIG_ARM_DMA_USE_IOMMU=y. The memory management code of Tegra DRM driver
has a longstanding overhaul overdue and it's not obvious where the problem
is in this case. Hence let's add back the old workaround which we already
had sometime before. It explicitly detaches DRM devices from the offending
implicit IOMMU domain. This fixes a completely broken 2d/3d drivers in
case of ARM32 multiplatform kernel config.

Cc: stable@vger.kernel.org
Fixes: fa6661b7aa0b ("drm/tegra: Optionally attach clients to the IOMMU")
Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/tegra/drm.c