From aa44d0e04158e7bcc452033e89ddde4053a24a00 Mon Sep 17 00:00:00 2001 From: Jon Hunter Date: Fri, 5 Nov 2021 10:48:52 +0000 Subject: [PATCH] gpu: nvgpu: Fix build for Linux v5.16-rc1 Building NVGPU against the current upstream mainline kernel is failing and errors such as the following are seen. ERROR: modpost: module nvgpu uses symbol dma_buf_map_attachment from namespace DMA_BUF, but does not import it. ERROR: modpost: module nvgpu uses symbol dma_buf_detach from namespace DMA_BUF, but does not import it. ERROR: modpost: module nvgpu uses symbol dma_buf_vmap from namespace DMA_BUF, but does not import it. Following upstream commit 16b0314aa746 ("dma-buf: move dma-buf symbols into the DMA_BUF module namespace"), it is now necessary to import the DMA_BUF module namespace into the NVGPU driver to fix this. Change-Id: I901b74cea692a5e0d66a190d01fe74a55aaf4431 Signed-off-by: Jon Hunter Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2621641 Tested-by: mobile promotions Reviewed-by: Sagar Kamble Reviewed-by: Konsta Holtta Reviewed-by: Alex Waterman Reviewed-by: mobile promotions GVS: Gerrit_Virtual_Submit --- drivers/gpu/nvgpu/os/linux/module.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/nvgpu/os/linux/module.c b/drivers/gpu/nvgpu/os/linux/module.c index c3772fc23..97153fac9 100644 --- a/drivers/gpu/nvgpu/os/linux/module.c +++ b/drivers/gpu/nvgpu/os/linux/module.c @@ -2002,6 +2002,9 @@ static void __exit gk20a_exit(void) platform_driver_unregister(&gk20a_driver); } +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 16, 0) +MODULE_IMPORT_NS(DMA_BUF); +#endif MODULE_LICENSE("GPL v2"); module_init(gk20a_init); module_exit(gk20a_exit);