gpu: nvgpu: Add ref counting to channels
authorAlex Waterman <alexw@nvidia.com>
Thu, 13 Oct 2016 17:03:59 +0000 (10:03 -0700)
committerWinnie Hsu <whsu@nvidia.com>
Mon, 26 Mar 2018 18:37:57 +0000 (11:37 -0700)
commit763ada650d0d24dde8d4ec90f665f16c8d7edab7
treeee35ea8b75a4222d9c8c38ea4a0372c8e8a2de13
parent7b67aa2c06e6906c6c190aabb1fa9722fd3cfb36
gpu: nvgpu: Add ref counting to channels

Make sure that the VM owned by a channel lives for at least
as long as that channel does. If the channel's VM is cleaned
up before the channel then use-after-free bugs can occur.

Bug: 31680980
NvBug 1825464
Bug: 1885921

Change-Id: I0711781492a764b643c2ed1da1b3ba87fda72744
Signed-off-by: Alex Waterman <alexw@nvidia.com>
Reviewed-on: https://git-psac.nvidia.com/r/#/c/9261
Signed-off-by: Debarshi Dutta <ddutta@nvidia.com>
(cherry picked from commit e205f2720fcee61886e7979e9588602d691507ea)
Reviewed-on: https://git-master.nvidia.com/r/1681801
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
drivers/gpu/nvgpu/gk20a/channel_gk20a.c
drivers/gpu/nvgpu/gk20a/mm_gk20a.c