mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-22 09:12:24 +03:00
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>