From 4ef0a332e861701b8b8781fb362a652bb9c654ee Mon Sep 17 00:00:00 2001 From: Laxman Dewangan Date: Tue, 21 Nov 2023 16:06:59 +0000 Subject: [PATCH] nvmap: Pass proper argument for get_file_rcu() for Linux 6.7 The function get_file_rcu() has modification in its argument to take the pointer to pointer of file from Linux 6.7 from below change *** commit 0ede61d8589cc2d93aa78230d74ac58b5b8d0244 Author: Christian Brauner file: convert to SLAB_TYPESAFE_BY_RCU *** Add support for Linux 6.7. Bug 4346767 Change-Id: I1e2e005900c7d2c57ac487b5f6ac5e1fcbfbafe7 Signed-off-by: Laxman Dewangan Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3020000 Reviewed-by: Suresh Mangipudi GVS: Gerrit_Virtual_Submit --- Makefile | 3 +++ drivers/video/tegra/nvmap/nvmap_handle.c | 4 ++++ drivers/video/tegra/nvmap/nvmap_sci_ipc.c | 4 ++++ 3 files changed, 11 insertions(+) diff --git a/Makefile b/Makefile index a6124f3c..731e88e8 100644 --- a/Makefile +++ b/Makefile @@ -92,6 +92,9 @@ subdir-ccflags-y += -DNV_DRM_DEBUGFS_REMOVE_HAS_ROOT_ARGS # pwm ops has dropped the .owner member subdir-ccflags-y += -DNV_PWM_OPS_HAS_NO_OWNER + +# get_file_rcu() have change the argument +subdir-ccflags-y += -DNV_GET_FILE_RCU_HAS_PTR_FILE_ARGS endif ifeq ($(CONFIG_TEGRA_VIRTUALIZATION),y) diff --git a/drivers/video/tegra/nvmap/nvmap_handle.c b/drivers/video/tegra/nvmap/nvmap_handle.c index 5f7c080b..6f4bf8f9 100644 --- a/drivers/video/tegra/nvmap/nvmap_handle.c +++ b/drivers/video/tegra/nvmap/nvmap_handle.c @@ -515,7 +515,11 @@ struct nvmap_handle_ref *nvmap_dup_handle_ro(struct nvmap_client *client, return ERR_CAST(h->dmabuf_ro); } } else { +#if defined(NV_GET_FILE_RCU_HAS_PTR_FILE_ARGS) + if (!get_file_rcu(&h->dmabuf_ro->file)) { +#else if (!get_file_rcu(h->dmabuf_ro->file)) { +#endif mutex_unlock(&h->lock); remain = wait_event_interruptible_timeout(h->waitq, !h->dmabuf_ro, (long)msecs_to_jiffies(100U)); diff --git a/drivers/video/tegra/nvmap/nvmap_sci_ipc.c b/drivers/video/tegra/nvmap/nvmap_sci_ipc.c index a808a2de..80855815 100644 --- a/drivers/video/tegra/nvmap/nvmap_sci_ipc.c +++ b/drivers/video/tegra/nvmap/nvmap_sci_ipc.c @@ -249,7 +249,11 @@ int nvmap_get_handle_from_sci_ipc_id(struct nvmap_client *client, u32 flags, goto unlock; } } else { +#if defined(NV_GET_FILE_RCU_HAS_PTR_FILE_ARGS) + if (!get_file_rcu(&h->dmabuf_ro->file)) { +#else if (!get_file_rcu(h->dmabuf_ro->file)) { +#endif mutex_unlock(&h->lock); remain = wait_event_interruptible_timeout(h->waitq, !h->dmabuf_ro, (long)msecs_to_jiffies(100U));