From 2c5337a24f7f2d02989dfb733c55d6d8c7e90493 Mon Sep 17 00:00:00 2001 From: Joshua Bakita Date: Sun, 29 Oct 2023 13:07:40 -0400 Subject: Update includes to L4T r32.7.4 and drop nvgpu/gk20a.h dependency Also add instructions for updating `include/`. These files are now only needed to build on Linux 4.9-based Tegra platforms. --- include/os/linux/ioctl_tsg.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'include/os/linux/ioctl_tsg.c') diff --git a/include/os/linux/ioctl_tsg.c b/include/os/linux/ioctl_tsg.c index 2f8cb3a..296b02b 100644 --- a/include/os/linux/ioctl_tsg.c +++ b/include/os/linux/ioctl_tsg.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2020, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2014-2021, NVIDIA CORPORATION. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, @@ -134,7 +134,10 @@ static int gk20a_tsg_unbind_channel_fd(struct tsg_gk20a *tsg, int ch_fd) goto out; } - err = gk20a_tsg_unbind_channel(ch); + err = gk20a_tsg_unbind_channel(ch, false); + if (err == -EAGAIN) { + goto out; + } /* * Mark the channel timedout since channel unbound from TSG @@ -307,17 +310,10 @@ static int gk20a_tsg_event_id_enable(struct tsg_gk20a *tsg, snprintf(name, sizeof(name), "nvgpu-event%d-fd%d", event_id, local_fd); - file = anon_inode_getfile(name, &gk20a_event_id_ops, - NULL, O_RDWR); - if (IS_ERR(file)) { - err = PTR_ERR(file); - goto clean_up; - } - event_id_data = nvgpu_kzalloc(tsg->g, sizeof(*event_id_data)); if (!event_id_data) { err = -ENOMEM; - goto clean_up_file; + goto clean_up; } event_id_data->g = g; event_id_data->id = tsg->tsgid; @@ -330,12 +326,18 @@ static int gk20a_tsg_event_id_enable(struct tsg_gk20a *tsg, nvgpu_init_list_node(&event_id_data->event_id_node); + file = anon_inode_getfile(name, &gk20a_event_id_ops, + event_id_data, O_RDWR); + if (IS_ERR(file)) { + err = PTR_ERR(file); + goto clean_up_free; + } + nvgpu_mutex_acquire(&tsg->event_id_list_lock); nvgpu_list_add_tail(&event_id_data->event_id_node, &tsg->event_id_list); nvgpu_mutex_release(&tsg->event_id_list_lock); fd_install(local_fd, file); - file->private_data = event_id_data; *fd = local_fd; @@ -343,8 +345,6 @@ static int gk20a_tsg_event_id_enable(struct tsg_gk20a *tsg, clean_up_free: nvgpu_kfree(g, event_id_data); -clean_up_file: - fput(file); clean_up: put_unused_fd(local_fd); free_ref: -- cgit v1.2.2