From d6685995db8bf12cbe2fd5fa0d74a2e7282d3a64 Mon Sep 17 00:00:00 2001 From: Jon Hunter Date: Thu, 18 Sep 2025 11:39:26 +0100 Subject: [PATCH] video: tegra: nvmap: Fix build for Linux v5.17+ MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Building NVMAP is failing for Linux v5.17, v5.18 and v5.19 and the following error is observed ... drivers/video/tegra/nvmap/nvmap_alloc.c: In function ‘handle_page_alloc’: drivers/video/tegra/nvmap/nvmap_alloc.c:521:14: error: implicit declaration of function ‘mmget_not_zero’; did you mean ‘min_not_zero’? [-Werror=implicit-function-declaration] 521 | if (!mmget_not_zero(mm)) | ^~~~~~~~~~~~~~ | min_not_zero The function 'mmget_not_zero' is present in these kernels and for all kernels is defined in the header file 'include/linux/sched/mm.h'. Ensure that this header is included by the NVMAP driver to fix the build. Bug 5222690 Change-Id: I98dcac3bb19d37bc0f5e9bd85d49a8cfe0923061 Signed-off-by: Jon Hunter Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3454945 GVS: buildbot_gerritrpt Reviewed-by: Ashish Mhetre --- drivers/video/tegra/nvmap/nvmap_alloc.c | 4 ++-- drivers/video/tegra/nvmap/nvmap_handle.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/video/tegra/nvmap/nvmap_alloc.c b/drivers/video/tegra/nvmap/nvmap_alloc.c index 6b0f80c1..815fa0eb 100644 --- a/drivers/video/tegra/nvmap/nvmap_alloc.c +++ b/drivers/video/tegra/nvmap/nvmap_alloc.c @@ -1,7 +1,6 @@ // SPDX-License-Identifier: GPL-2.0-only +// SPDX-FileCopyrightText: Copyright (c) 2011-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. /* - * Copyright (c) 2011-2025, NVIDIA CORPORATION. All rights reserved. - * * Handle allocation and freeing routines for nvmap */ @@ -29,6 +28,7 @@ #endif /* NVMAP_UPSTREAM_KERNEL */ #include "nvmap_priv.h" #include +#include bool nvmap_convert_carveout_to_iovmm; bool nvmap_convert_iovmm_to_carveout; diff --git a/drivers/video/tegra/nvmap/nvmap_handle.c b/drivers/video/tegra/nvmap/nvmap_handle.c index fff983b0..32cd0a9a 100644 --- a/drivers/video/tegra/nvmap/nvmap_handle.c +++ b/drivers/video/tegra/nvmap/nvmap_handle.c @@ -1,7 +1,6 @@ // SPDX-License-Identifier: GPL-2.0-only +// SPDX-FileCopyrightText: Copyright (c) 2009-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. /* - * Copyright (c) 2009-2025, NVIDIA CORPORATION. All rights reserved. - * * Handle allocation and freeing routines for nvmap */ @@ -14,6 +13,7 @@ #include #include #include +#include #include #include #include