mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-22 09:12:24 +03:00
gpu: nvgpu: free VEID if the channel is closed
In case of process crash or forceful closure of the channels, userspace may not release the VEID. In that case, creating further subcontexts may not be possible. Hence, when the channel is closed forcibly (linux), release the VEID on closure of the last channel in the subcontext. With this, normally on linux, channel close will not relase the VEID However, on qnx it will release the VEID. So delete subcontext devctl call on qnx will be nop in normal case hence changed the error print and error return to success. Also added check in the subcontext delete ioctl fn that all channels are unbound before deleting the subcontext. This is to ensure that channels don't refer to dangling subcontext pointer. Bug 3979886 Change-Id: I434944b01740720011abce3664394ae8cb0d4e2e Signed-off-by: Sagar Kamble <skamble@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2858060 Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com> Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com> Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com> GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
53dc53a8b4
commit
a5640d61bd
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2019-2022, NVIDIA CORPORATION. All rights reserved.
|
||||
* Copyright (c) 2019-2023, NVIDIA CORPORATION. All rights reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
@@ -415,7 +415,7 @@ int test_gr_obj_ctx_error_injection(struct unit_module *m,
|
||||
}
|
||||
|
||||
/* Cleanup */
|
||||
nvgpu_tsg_subctx_unbind_channel(tsg, channel);
|
||||
nvgpu_tsg_subctx_unbind_channel(tsg, channel, false);
|
||||
nvgpu_gr_ctx_free(g, gr_ctx, global_desc);
|
||||
nvgpu_free_gr_ctx_struct(g, gr_ctx);
|
||||
nvgpu_gr_ctx_desc_free(g, desc);
|
||||
|
||||
Reference in New Issue
Block a user