]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
gpu: host1x: Avoid trying to use GART on Tegra20
authorRobin Murphy <robin.murphy@arm.com>
Thu, 20 Oct 2022 14:23:40 +0000 (15:23 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 2 Dec 2022 16:40:05 +0000 (17:40 +0100)
[ Upstream commit c2418f911a31a266af4fbaca998dc73d3676475a ]

Since commit c7e3ca515e78 ("iommu/tegra: gart: Do not register with
bus") quite some time ago, the GART driver has effectively disabled
itself to avoid issues with the GPU driver expecting it to work in ways
that it doesn't. As of commit 57365a04c921 ("iommu: Move bus setup to
IOMMU device registration") that bodge no longer works, but really the
GPU driver should be responsible for its own behaviour anyway. Make the
workaround explicit.

Reported-by: Jon Hunter <jonathanh@nvidia.com>
Suggested-by: Dmitry Osipenko <digetx@gmail.com>
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
Tested-by: Jon Hunter <jonathanh@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/tegra/drm.c
drivers/gpu/host1x/dev.c

index 2c6ebc328b24f6c88a713ad43d16a142191084a1..318692ad9680f40771836837bc7a87bd42a858ac 100644 (file)
@@ -1042,6 +1042,10 @@ static bool host1x_drm_wants_iommu(struct host1x_device *dev)
        struct host1x *host1x = dev_get_drvdata(dev->dev.parent);
        struct iommu_domain *domain;
 
+       /* Our IOMMU usage policy doesn't currently play well with GART */
+       if (of_machine_is_compatible("nvidia,tegra20"))
+               return false;
+
        /*
         * If the Tegra DRM clients are backed by an IOMMU, push buffers are
         * likely to be allocated beyond the 32-bit boundary if sufficient
index 8659558b518d6afc3100c19631363c42e6fe1b43..9f674a8d5009dbdb4a561743c6aa9ff1a4d7db4a 100644 (file)
@@ -198,6 +198,10 @@ static void host1x_setup_sid_table(struct host1x *host)
 
 static bool host1x_wants_iommu(struct host1x *host1x)
 {
+       /* Our IOMMU usage policy doesn't currently play well with GART */
+       if (of_machine_is_compatible("nvidia,tegra20"))
+               return false;
+
        /*
         * If we support addressing a maximum of 32 bits of physical memory
         * and if the host1x firewall is enabled, there's no need to enable