diff --git a/Makefile b/Makefile index 076165df..cda77883 100644 --- a/Makefile +++ b/Makefile @@ -53,6 +53,12 @@ subdir-ccflags-y += -DNV_V4L2_ASYNC_NF_SUBDEVICE_INIT_RENAME export CONFIG_SKIP_CRYPTO=y endif +# Changes done in Linux 6.7 onwards +ifeq ($(shell test $(LINUX_VERSION) -ge $(LINUX_VERSION_6_7); echo $$?),0) +# get_file_rcu() have change the argument +subdir-ccflags-y += -DNV_GET_FILE_RCU_HAS_PTR_FILE_ARGS +endif + ifeq ($(CONFIG_TEGRA_VIRTUALIZATION),y) subdir-ccflags-y += -DCONFIG_TEGRA_VIRTUALIZATION endif diff --git a/drivers/video/tegra/nvmap/nvmap_handle.c b/drivers/video/tegra/nvmap/nvmap_handle.c index 9953b78c..42f07981 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));