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 <brauner@kernel.org>

    file: convert to SLAB_TYPESAFE_BY_RCU
***

Add support for Linux 6.7.

Bug 4346767

Change-Id: I1e2e005900c7d2c57ac487b5f6ac5e1fcbfbafe7
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3020000
Reviewed-by: Suresh Mangipudi <smangipudi@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
This commit is contained in:
Laxman Dewangan
2023-11-21 16:06:59 +00:00
committed by mobile promotions
parent 9de2a9da7f
commit 4ef0a332e8
3 changed files with 11 additions and 0 deletions

View File

@@ -92,6 +92,9 @@ subdir-ccflags-y += -DNV_DRM_DEBUGFS_REMOVE_HAS_ROOT_ARGS
# pwm ops has dropped the .owner member # pwm ops has dropped the .owner member
subdir-ccflags-y += -DNV_PWM_OPS_HAS_NO_OWNER 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 endif
ifeq ($(CONFIG_TEGRA_VIRTUALIZATION),y) ifeq ($(CONFIG_TEGRA_VIRTUALIZATION),y)

View File

@@ -515,7 +515,11 @@ struct nvmap_handle_ref *nvmap_dup_handle_ro(struct nvmap_client *client,
return ERR_CAST(h->dmabuf_ro); return ERR_CAST(h->dmabuf_ro);
} }
} else { } 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)) { if (!get_file_rcu(h->dmabuf_ro->file)) {
#endif
mutex_unlock(&h->lock); mutex_unlock(&h->lock);
remain = wait_event_interruptible_timeout(h->waitq, remain = wait_event_interruptible_timeout(h->waitq,
!h->dmabuf_ro, (long)msecs_to_jiffies(100U)); !h->dmabuf_ro, (long)msecs_to_jiffies(100U));

View File

@@ -249,7 +249,11 @@ int nvmap_get_handle_from_sci_ipc_id(struct nvmap_client *client, u32 flags,
goto unlock; goto unlock;
} }
} else { } 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)) { if (!get_file_rcu(h->dmabuf_ro->file)) {
#endif
mutex_unlock(&h->lock); mutex_unlock(&h->lock);
remain = wait_event_interruptible_timeout(h->waitq, remain = wait_event_interruptible_timeout(h->waitq,
!h->dmabuf_ro, (long)msecs_to_jiffies(100U)); !h->dmabuf_ro, (long)msecs_to_jiffies(100U));