From 5dad8295a6b05ab60a268a1336f3f91c65c6b51b Mon Sep 17 00:00:00 2001 From: Jon Hunter Date: Tue, 28 Feb 2023 17:17:22 +0000 Subject: [PATCH] gpu: host1x: Fix build for Linux v6.3 Upstream Linux commit ("1369459b2e21 iommu: Add a gfp parameter to iommu_map()") adds a new parameter to the iommu_map function and this breaks building the host1x driver with Linux v6.3. Upstream Linux commit 2a81ada32f0e ("driver core: make struct bus_type.uevent() take a const *") updates the uevent function pointer type to make the device structure const which also breaks building the host1x driver with Linux v6.3. Address both of these issues to fix building the host1x driver with Linux v6.3. Bug 4014315 Change-Id: Ibd27f5e8442cc6970bcaac0dcfb9fc262860aee9 Signed-off-by: Jon Hunter Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2867136 Reviewed-by: Mikko Perttunen Reviewed-by: svc_kernel_abi GVS: Gerrit_Virtual_Submit --- drivers/gpu/drm/tegra/drm.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/drm/tegra/drm.c b/drivers/gpu/drm/tegra/drm.c index b9070256..b23886bf 100644 --- a/drivers/gpu/drm/tegra/drm.c +++ b/drivers/gpu/drm/tegra/drm.c @@ -1055,7 +1055,11 @@ void *tegra_drm_alloc(struct tegra_drm *tegra, size_t size, dma_addr_t *dma) *dma = iova_dma_addr(&tegra->carveout.domain, alloc); err = iommu_map(tegra->domain, *dma, virt_to_phys(virt), +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 3, 0) + size, IOMMU_READ | IOMMU_WRITE, GFP_KERNEL); +#else size, IOMMU_READ | IOMMU_WRITE); +#endif if (err < 0) goto free_iova;