From bd134326f8de0ebf89277368db27354df676d855 Mon Sep 17 00:00:00 2001 From: prsethi Date: Wed, 30 Nov 2022 04:28:17 +0000 Subject: [PATCH] gpu: nvgpu: reset the nvs user mask before resetting the queue user->active_used_queues mask should be unset before the queue->mask gets reset as part of queue->free calls otherwise user will be considered as active and will avoid the proper cleanup. Bug 3884011 Change-Id: I7a9d620a5dae057df2eb41fced8c801e14639e61 Signed-off-by: prsethi Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2818962 Tested-by: mobile promotions Reviewed-by: mobile promotions --- drivers/gpu/nvgpu/os/linux/ioctl_nvs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/nvgpu/os/linux/ioctl_nvs.c b/drivers/gpu/nvgpu/os/linux/ioctl_nvs.c index 138fb3b12..6f95b5876 100644 --- a/drivers/gpu/nvgpu/os/linux/ioctl_nvs.c +++ b/drivers/gpu/nvgpu/os/linux/ioctl_nvs.c @@ -966,6 +966,8 @@ static int nvgpu_nvs_ctrl_fifo_destroy_queue(struct gk20a *g, goto fail; } + nvgpu_nvs_ctrl_fifo_user_unsubscribe_queue(user, queue); + /* For Event Queues, don't erase even if the buffer * is currently not mapped. There might be some observers * who has acquired the dma_bufs but hasn't mapped yet. @@ -982,8 +984,6 @@ static int nvgpu_nvs_ctrl_fifo_destroy_queue(struct gk20a *g, } } - nvgpu_nvs_ctrl_fifo_user_unsubscribe_queue(user, queue); - nvgpu_nvs_ctrl_fifo_unlock_queues(g); return 0;