From c8262cbee12c2d7168bc6ec6970edb3649fcd46d Mon Sep 17 00:00:00 2001 From: Laxman Dewangan Date: Fri, 1 Dec 2023 08:46:35 +0000 Subject: [PATCH] nvadsp: os: Fix the argument of iommu_map() for Linux 6.3 There is additional argument added in iommu_map() from Linux6.3. Pass the proper argument from the drier who are using this APIs. Using conftest methods for differentiating whether additional argument is needed or not. Bug 4374520 Change-Id: I0844beb3338a2d5237832867547d05da91a41a5f Signed-off-by: Laxman Dewangan Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3026351 Reviewed-by: Viswanath L GVS: Gerrit_Virtual_Submit --- drivers/platform/tegra/nvadsp/os.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/platform/tegra/nvadsp/os.c b/drivers/platform/tegra/nvadsp/os.c index 28d1ebc2..7e3e0ab6 100644 --- a/drivers/platform/tegra/nvadsp/os.c +++ b/drivers/platform/tegra/nvadsp/os.c @@ -2,6 +2,7 @@ /** * Copyright (c) 2014-2023, NVIDIA CORPORATION. All rights reserved. */ +#include #include #include @@ -769,7 +770,11 @@ static void *nvadsp_dma_alloc_and_map_at(struct platform_device *pdev, /* Remap the contiguous physical addresses together */ ret = iommu_map(domain, iova + offset, pa, mp_size, +#if defined(NV_IOMMU_MAP_HAS_GFP_ARG) + IOMMU_READ | IOMMU_WRITE, GFP_KERNEL); +#else IOMMU_READ | IOMMU_WRITE); +#endif if (ret) { dev_err(dev, "failed to map pa %llx va %llx size %lx\n", pa, iova + offset, mp_size);