From ee3c149b7f9e65b97c2598805f93863ff20da6e5 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/host1x/bus.c | 5 +++++ drivers/gpu/host1x/cdma.c | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/drivers/gpu/host1x/bus.c b/drivers/gpu/host1x/bus.c index 712ce483..201750f4 100644 --- a/drivers/gpu/host1x/bus.c +++ b/drivers/gpu/host1x/bus.c @@ -11,6 +11,7 @@ #include #include #include +#include #include "bus.h" #include "dev.h" @@ -338,7 +339,11 @@ static int host1x_device_match(struct device *dev, struct device_driver *drv) return strcmp(dev_name(dev), drv->name) == 0; } +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 3, 0) +static int host1x_device_uevent(const struct device *dev, +#else static int host1x_device_uevent(struct device *dev, +#endif struct kobj_uevent_env *env) { struct device_node *np = dev->parent->of_node; diff --git a/drivers/gpu/host1x/cdma.c b/drivers/gpu/host1x/cdma.c index 582f0487..256fc395 100644 --- a/drivers/gpu/host1x/cdma.c +++ b/drivers/gpu/host1x/cdma.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include "cdma.h" @@ -105,7 +106,11 @@ static int host1x_pushbuffer_init(struct push_buffer *pb) pb->dma = iova_dma_addr(&host1x->iova, alloc); err = iommu_map(host1x->domain, pb->dma, pb->phys, size, +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 3, 0) + IOMMU_READ, GFP_KERNEL); +#else IOMMU_READ); +#endif if (err) goto iommu_free_iova; } else {