gpu: nvgpu: protect channel ioctls with a mutex
authorKonsta Holtta <kholtta@nvidia.com>
Thu, 29 Jan 2015 08:35:04 +0000 (10:35 +0200)
committerTerje Bergstrom <tbergstrom@nvidia.com>
Sat, 28 Feb 2015 16:55:01 +0000 (08:55 -0800)
commit0761053dbe1111b55f5ae3148f03c8060071046b
treec654877ec01b744698e89b550d8fc0d0be9aab52
parent87dcc1f3c21a86b88f08bdf722dae8d1d1324a41
gpu: nvgpu: protect channel ioctls with a mutex

Add a big mutex for protecting the channel during ioctls, in case the
userspace uses the same channel from several threads at once. The lock
is taken during all operations except CHANNEL_WAIT, which could deadlock.

Bug 1603482

Change-Id: Ibed962eadc9f00645abd54413dde9aaee00377ab
Signed-off-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-on: http://git-master/r/678871
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Tested-by: Terje Bergstrom <tbergstrom@nvidia.com>
drivers/gpu/nvgpu/gk20a/channel_gk20a.c
drivers/gpu/nvgpu/gk20a/channel_gk20a.h